]> granicus.if.org Git - curl/commitdiff
conversions: fix several compiler warnings
authorDaniel Stenberg <daniel@haxx.se>
Sun, 10 Sep 2017 22:31:12 +0000 (00:31 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 15 Sep 2017 14:58:35 +0000 (16:58 +0200)
lib/transfer.c
lib/vtls/openssl.c

index 792d5aff872fbf3062f3e66008f21a290c1a5d95..8e66d0d80edd489cda5bf769f44fe3ad40699032 100644 (file)
@@ -221,20 +221,21 @@ CURLcode Curl_fillreadbuffer(struct connectdata *conn, int bytes, int *nreadp)
            strlen(endofline_network));
 
 #ifdef CURL_DOES_CONVERSIONS
-    CURLcode result;
-    int length;
-    if(data->set.prefer_ascii) {
-      /* translate the protocol and data */
-      length = nread;
-    }
-    else {
-      /* just translate the protocol portion */
-      length = strlen(hexbuffer);
+    {
+      CURLcode result;
+      int length;
+      if(data->set.prefer_ascii)
+        /* translate the protocol and data */
+        length = nread;
+      else
+        /* just translate the protocol portion */
+        length = (int)strlen(hexbuffer);
+      result = Curl_convert_to_network(data, data->req.upload_fromhere,
+                                       length);
+      /* Curl_convert_to_network calls failf if unsuccessful */
+      if(result)
+        return result;
     }
-    result = Curl_convert_to_network(data, data->req.upload_fromhere, length);
-    /* Curl_convert_to_network calls failf if unsuccessful */
-    if(result)
-      return result;
 #endif /* CURL_DOES_CONVERSIONS */
 
     if((nread - hexlen) == 0)
index ccaf032c2df8c0b28447081678b2736e16695fee..2933584b347db3e85ed12a3fdc40569242c54385 100644 (file)
@@ -1478,7 +1478,8 @@ static CURLcode verifyhost(struct connectdata *conn, X509 *server_cert)
        peer_CN = NULL;
     else {
       /* convert peer_CN from UTF8 */
-      CURLcode rc = Curl_convert_from_utf8(data, peer_CN, strlen(peer_CN));
+      CURLcode rc = Curl_convert_from_utf8(data, (char *)peer_CN,
+                                           strlen((char *)peer_CN));
       /* Curl_convert_from_utf8 calls failf if unsuccessful */
       if(rc) {
         OPENSSL_free(peer_CN);