1
0
mirror of https://github.com/moparisthebest/curl synced 2025-02-28 17:31:46 -05:00

lib554.c: use curl_formadd() properly

The length/size options take longs so make sure to pass on such types.

Reported by: Neil Bowers
Bug: http://curl.haxx.se/mail/lib-2012-06/0001.html
This commit is contained in:
Daniel Stenberg 2012-06-07 23:08:35 +02:00
parent 0636af6131
commit 2e48139fbf

View File

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@ -88,7 +88,7 @@ int test(char *URL)
&lastptr, &lastptr,
CURLFORM_COPYNAME, "sendfile", CURLFORM_COPYNAME, "sendfile",
CURLFORM_STREAM, &pooh, CURLFORM_STREAM, &pooh,
CURLFORM_CONTENTSLENGTH, pooh.sizeleft, CURLFORM_CONTENTSLENGTH, (long)pooh.sizeleft,
CURLFORM_FILENAME, "postit2.c", CURLFORM_FILENAME, "postit2.c",
CURLFORM_END); CURLFORM_END);
@ -106,7 +106,7 @@ int test(char *URL)
&lastptr, &lastptr,
CURLFORM_COPYNAME, "callbackdata", CURLFORM_COPYNAME, "callbackdata",
CURLFORM_STREAM, &pooh2, CURLFORM_STREAM, &pooh2,
CURLFORM_CONTENTSLENGTH, pooh2.sizeleft, CURLFORM_CONTENTSLENGTH, (long)pooh2.sizeleft,
CURLFORM_END); CURLFORM_END);
if(formrc) if(formrc)
@ -149,7 +149,7 @@ int test(char *URL)
CURLFORM_COPYNAME, "somename", CURLFORM_COPYNAME, "somename",
CURLFORM_BUFFER, "somefile.txt", CURLFORM_BUFFER, "somefile.txt",
CURLFORM_BUFFERPTR, "blah blah", CURLFORM_BUFFERPTR, "blah blah",
CURLFORM_BUFFERLENGTH, 9, CURLFORM_BUFFERLENGTH, (long)9,
CURLFORM_END); CURLFORM_END);
if(formrc) if(formrc)