[prev in list] [next in list] [prev in thread] [next in thread] 

List:       curl-commits
Subject:    cvs: curl /docs/examples httpput.c
From:       "Daniel Stenberg" <bagder () php ! net>
Date:       2003-12-18 18:05:10
[Download RAW message or body]

bagder		Thu Dec 18 13:05:10 2003 EDT

  Modified files:              
    /curl/docs/examples	httpput.c 
  Log:
  typecast the size to long for platforms where st_size is off_t
  
  
Index: curl/docs/examples/httpput.c
diff -u curl/docs/examples/httpput.c:1.3 curl/docs/examples/httpput.c:1.4
--- curl/docs/examples/httpput.c:1.3	Thu Dec 18 02:52:31 2003
+++ curl/docs/examples/httpput.c	Thu Dec 18 13:05:10 2003
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___ 
  *                             \___|\___/|_| \_\_____|
  *
- * $Id: httpput.c,v 1.3 2003/12/18 07:52:31 bagder Exp $
+ * $Id: httpput.c,v 1.4 2003/12/18 18:05:10 bagder Exp $
  */
 
 #include <stdio.h>
@@ -85,8 +85,9 @@
     /* 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);




-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic