cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Unable to send the image file.

From: Tor Arntsen <kspt.tor_at_gmail.com>
Date: Tue, 16 Apr 2013 14:36:08 +0200

> Le 2013-04-16 07:17, Anil J a écrit :
>> buffer = (char *)malloc(fileLen + 1);

Also, don't cast malloc(). It returns a void* which is compatible with
all pointers.
Casting the return from malloc() isn't only unnecessary, it can hide errors.
If you get a message without the cast it simply means you've forgotten to
#include <stdlib.h>

-Tor

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-04-16