]> granicus.if.org Git - curl/commitdiff
string formatting: fix 4 printf-style format strings
authorMichael Kaufmann <mail@michael-kaufmann.ch>
Sun, 19 Feb 2017 13:10:54 +0000 (14:10 +0100)
committerMichael Kaufmann <mail@michael-kaufmann.ch>
Sun, 19 Feb 2017 13:13:42 +0000 (14:13 +0100)
lib/conncache.c
lib/curl_ntlm_core.c
src/tool_operate.c
src/tool_urlglob.c

index d8ef9a54c714abc687a635ca08a82ace294f47e4..a51c8fd7603da4a1614c3b2614db15d99014ac24 100644 (file)
@@ -141,7 +141,7 @@ static char *hashkey(struct connectdata *conn)
   else
     hostname = conn->host.name;
 
-  return aprintf("%s:%d", hostname, conn->port);
+  return aprintf("%s:%ld", hostname, conn->port);
 }
 
 /* Look up the bundle with all the connections to the same host this
index e8b763aaca31af8b293131dabc6c50935be34788..e02983ce6ad77b3ec34f29dc269487609f297790 100644 (file)
@@ -715,8 +715,10 @@ CURLcode Curl_ntlm_core_mk_ntlmv2_resp(unsigned char *ntlmv2hash,
 
   /* Create the BLOB structure */
   snprintf((char *)ptr + NTLM_HMAC_MD5_LEN, NTLMv2_BLOB_LEN,
-           NTLMv2_BLOB_SIGNATURE
+           "%c%c%c%c"   /* NTLMv2_BLOB_SIGNATURE */
            "%c%c%c%c",  /* Reserved = 0 */
+           NTLMv2_BLOB_SIGNATURE[0], NTLMv2_BLOB_SIGNATURE[1],
+           NTLMv2_BLOB_SIGNATURE[2], NTLMv2_BLOB_SIGNATURE[3],
            0, 0, 0, 0);
 
   Curl_write64_le(tw, ptr + 24);
index ef4f74a2b40bba926b83ed198a3be74be95da337..bc36520d9a26a9331a2802546a0fa9944455e99e 100644 (file)
@@ -1622,7 +1622,7 @@ static CURLcode operate_do(struct GlobalConfig *global,
                   metalink_next_res = 1;
                   fprintf(global->errors,
                           "Metalink: fetching (%s) from (%s) FAILED "
-                          "(HTTP status code %d)\n",
+                          "(HTTP status code %ld)\n",
                           mlfile->filename, this_url, response);
                 }
               }
index 6d716599f7292e0fdcc84412db8dbaf00f57da86..d002f276d32c6680055f625e66791dc1e217f8c3 100644 (file)
@@ -645,7 +645,7 @@ CURLcode glob_match_url(char **result, char *filename, URLGlob *glob)
           appendlen = 1;
           break;
         case UPTNumRange:
-          snprintf(numbuf, sizeof(numbuf), "%0*d",
+          snprintf(numbuf, sizeof(numbuf), "%0*lu",
                    pat->content.NumRange.padlength,
                    pat->content.NumRange.ptr_n);
           appendthis = numbuf;