diff options
-rw-r--r-- | lib/http.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/http.c b/lib/http.c index cc4ac8fe1..b135912bb 100644 --- a/lib/http.c +++ b/lib/http.c @@ -924,8 +924,9 @@ CURLcode Curl_http(struct connectdata *conn) actually set your own */ add_bufferf(req_buffer, "Content-Length: %d\r\n", - (data->set.postfieldsize?data->set.postfieldsize: - strlen(data->set.postfields)) ); + data->set.postfieldsize? + data->set.postfieldsize: + (data->set.postfields?strlen(data->set.postfields):0) ); if(!checkheaders(data, "Content-Type:")) add_bufferf(req_buffer, |