cURL / Mailing Lists / curl-library / Single Mail


Re: curl send wrong data ?

From: Daniel Stenberg <>
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,
> "",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 -- --
      Dedicated custom curl help for hire:
Received on 2004-06-04