]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tool: make the length argument an int for printf()-.* flags
authorDaniel Stenberg <daniel@haxx.se>
Wed, 2 Aug 2023 12:08:26 +0000 (14:08 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 2 Aug 2023 14:11:55 +0000 (16:11 +0200)
Closes #11578

src/tool_cb_hdr.c
src/tool_setopt.c

index 47780232407700a03b7af9dbd3da9145b251cb1e..aab96ae0374e297ca34662bc9a5d0473af372209 100644 (file)
@@ -213,7 +213,7 @@ size_t tool_header_cb(char *ptr, size_t size, size_t nmemb, void *userdata)
       value = memchr(ptr, ':', cb);
     if(value) {
       size_t namelen = value - ptr;
-      fprintf(outs->stream, BOLD "%.*s" BOLDOFF ":", namelen, ptr);
+      fprintf(outs->stream, BOLD "%.*s" BOLDOFF ":", (int)namelen, ptr);
 #ifndef LINK
       fwrite(&value[1], cb - namelen - 1, 1, outs->stream);
 #else
@@ -402,7 +402,7 @@ void write_linked_location(CURL *curl, const char *location, size_t loclen,
      !strcmp("ftp", scheme) ||
      !strcmp("ftps", scheme)) {
     fprintf(stream, LINK "%s" LINKST "%.*s" LINKOFF,
-            finalurl, loclen, location);
+            finalurl, (int)loclen, location);
     goto locdone;
   }
 
index 08e8c2373bce17e780867ee4a2a3093fc4ac7ee9..905f3eb3e7458e6e380ed05100bdda4f1cc36aa8 100644 (file)
@@ -328,7 +328,8 @@ CURLcode tool_setopt_flags(CURL *curl, struct GlobalConfig *config,
         if(!rest)
           break;                /* handled them all */
         /* replace with all spaces for continuation line */
-        msnprintf(preamble, sizeof(preamble), "%*s", strlen(preamble), "");
+        msnprintf(preamble, sizeof(preamble), "%*s", (int)strlen(preamble),
+                  "");
       }
     }
     /* If any bits have no definition, output an explicit value.
@@ -371,7 +372,8 @@ CURLcode tool_setopt_bitmask(CURL *curl, struct GlobalConfig *config,
         if(!rest)
           break;                /* handled them all */
         /* replace with all spaces for continuation line */
-        msnprintf(preamble, sizeof(preamble), "%*s", strlen(preamble), "");
+        msnprintf(preamble, sizeof(preamble), "%*s", (int)strlen(preamble),
+                  "");
       }
     }
     /* If any bits have no definition, output an explicit value.