cURL / Mailing Lists / curl-library / Single Mail


Re: failed tests building curl 7.26

From: Daniel Stenberg <>
Date: Thu, 7 Jun 2012 22:28:10 +0200 (CEST)

On Thu, 7 Jun 2012, Neil Bowers wrote:

> The problem is the following code at line 148 of lib554.c
> formrc = curl_formadd(&formpost, &lastptr,
> CURLFORM_COPYNAME, "somename",
> CURLFORM_BUFFER, "somefile.txt",
> CURLFORM_BUFFERPTR, "blah blah",
> The two lines in red need to be switched, as the Curl_getformdata expects
> BUFFERLENGTH to be defined before you refer to BUFFERPTR. With this change
> curl 7.26 builds cleanly -- yippee!

No really no, that's not the _problem_. That's a work-around to hide the
problem from happening to you. The API for curl_formadd() allows them to be
added in that order so the function should be fixed to handle it.

I would rather suggest this, since CURLFORM_BUFFERLENGTH must be a long and
without an explicit type here it will be passed in as an int:

diff --git a/tests/libtest/lib554.c b/tests/libtest/lib554.c
index d20429d..950cafc 100644
--- a/tests/libtest/lib554.c
+++ b/tests/libtest/lib554.c
@@ -149,7 +149,7 @@ int test(char *URL)
                          CURLFORM_COPYNAME, "somename",
                          CURLFORM_BUFFER, "somefile.txt",
                          CURLFORM_BUFFERPTR, "blah blah",


List admin:
Received on 2012-06-07