cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: curl send wrong data ?

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Fri, 4 Jun 2004 15:04:33 +0200 (CEST)

On Fri, 4 Jun 2004, Blaz Smolnikar wrote:

...

> char *str;

...

> char* url = malloc((strlen(url) + strlen(str), sizeof(char)));

What is this line supposed to do? url isn't assigned, str isn't assigned,
sizeof(char) is 1. What are you allocating _really_ ?

> sprintf(url,
> "planet-si.net/addsong.php?action=add&art=%s&tit=test&time=2:21&kbps=320",str);

... and if you make sure you output the URL after this, and then compare it
with what URL libcurl used, I bet you'll see that they are the same.

I'd recommend you to think through your program again, and check return codes
for errors etc.

-- 
     Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
      Dedicated custom curl help for hire: http://haxx.se/curl.html
Received on 2004-06-04