summaryrefslogtreecommitdiff
path: root/docs/examples/httpput.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2003-12-18 18:05:10 +0000
committerDaniel Stenberg <daniel@haxx.se>2003-12-18 18:05:10 +0000
commit36a2fac79f8751dca9075e83803b6cfa04d82387 (patch)
treecbb66fc72f545e45e360ca7e87dcec800d51ee5d /docs/examples/httpput.c
parent58cf10825153cc549ee0c28a48578e8133df1509 (diff)
downloadcurl-36a2fac79f8751dca9075e83803b6cfa04d82387.tar.gz
typecast the size to long for platforms where st_size is off_t
Diffstat (limited to 'docs/examples/httpput.c')
-rw-r--r--docs/examples/httpput.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/docs/examples/httpput.c b/docs/examples/httpput.c
index ec80d3c9a..48c9f70ec 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);