curl-library
Re: bad post strings?
Date: Tue, 5 Jun 2001 15:07:01 +0200 (MET DST)
On Mon, 4 Jun 2001, John Baxter wrote:
> I tried your suggestion, here is the output I get...
Oh. I haven't compiled formdata.c for debug in while and so it doesn't build
cleanly. Try the tiny patch applied, it corrects the test program.
I built it with:
gcc -DHAVE_CONFIG_H -I../ -I../include -g -D_FORM_DEBUG -o formdata
formdata.c strequal.o
Notice the strequal.o object file, which is required for the curl_strequal()
function.
Then run the 'formdata' program like:
./formdata name=contents name2=weeeeeirdo
It'll then write the entire RFC1867-blurb posting to stdout.
> also, in my write to memory function... I find that the (char *)ptr
> string is 2 char longer with strlen(ptr) than with (size * nmemb).
No one ever said you can strlen() that pointer. That's just a block of data
without any trailing zero. strlen() is likely to return a bogus value, yes.
-- Daniel Stenberg -- curl dude -- http://curl.haxx.se/
_______________________________________________
Curl-library mailing list
Curl-library_at_lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/curl-library
- TEXT/PLAIN attachment: formdata-fix.patch