]> granicus.if.org Git - curl/commitdiff
curl: support >256 bytes warning messsages
authorDaniel Stenberg <daniel@haxx.se>
Tue, 12 Dec 2017 18:58:47 +0000 (19:58 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 12 Dec 2017 18:59:29 +0000 (19:59 +0100)
Bug: #2174

src/tool_msgs.c

index 07bf81292c8b7c601bab568f97af50f0717812e8..91d62ec1ed9ec732f92942e1fd9ee30f43fe5374 100644 (file)
@@ -42,9 +42,12 @@ static void voutf(struct GlobalConfig *config,
   if(!config->mute) {
     size_t len;
     char *ptr;
-    char print_buffer[256];
+    char *print_buffer;
 
-    len = vsnprintf(print_buffer, sizeof(print_buffer), fmt, ap);
+    print_buffer = curlx_mvaprintf(fmt, ap);
+    if(!print_buffer)
+      return;
+    len = strlen(print_buffer);
 
     ptr = print_buffer;
     while(len > 0) {
@@ -71,6 +74,7 @@ static void voutf(struct GlobalConfig *config,
         len = 0;
       }
     }
+    curl_free(print_buffer);
   }
 }