diff --git a/docs/examples/httpput.c b/docs/examples/httpput.c index ec80d3c9a347a3f1ab094d211eda16e07ad43c39..48c9f70ec50a8732dba4d938a25acaa6b0f039f6 100644 --- a/docs/examples/httpput.c +++ b/docs/examples/httpput.c @@ -85,8 +85,9 @@ int main(int argc, char **argv) /* now specify which file to upload */ curl_easy_setopt(curl, CURLOPT_READDATA, hd_src); - /* and give the size of the upload (optional) */ - curl_easy_setopt(curl, CURLOPT_INFILESIZE, file_info.st_size); + /* and give the size of the upload, make sure that we don't accidentally + pass a larger variable type than "long". */ + curl_easy_setopt(curl, CURLOPT_INFILESIZE, (long) file_info.st_size); /* Now run off and do what you've been told! */ res = curl_easy_perform(curl);