]> granicus.if.org Git - curl/commitdiff
url.c: Fixed compilation warning
authorSteve Holme <steve_holme@hotmail.com>
Wed, 5 Nov 2014 12:42:35 +0000 (12:42 +0000)
committerSteve Holme <steve_holme@hotmail.com>
Wed, 5 Nov 2014 12:42:35 +0000 (12:42 +0000)
conversion from 'curl_off_t' to 'size_t', possible loss of data

lib/url.c

index 40d4fed598a7310458e5285078a02d022cbf2c93..3a877fc87e179ef53536e2985ace06620d891baf 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -368,7 +368,8 @@ CURLcode Curl_dupset(struct SessionHandle *dst, struct SessionHandle *src)
   i = STRING_COPYPOSTFIELDS;
   if(src->set.postfieldsize && src->set.str[i]) {
     /* postfieldsize is curl_off_t, Curl_memdup() takes a size_t ... */
-    dst->set.str[i] = Curl_memdup(src->set.str[i], src->set.postfieldsize);
+    dst->set.str[i] = Curl_memdup(src->set.str[i],
+                                  curlx_sotouz(src->set.postfieldsize));
     if(!dst->set.str[i])
       return CURLE_OUT_OF_MEMORY;
     /* point to the new copy */