]> granicus.if.org Git - curl/commitdiff
tool_setopt: fix c_escape truncated octal
authorMaksim Stsepanenka <mstsepanenka@gmail.com>
Fri, 2 Oct 2015 06:43:57 +0000 (02:43 -0400)
committerJay Satiro <raysatiro@yahoo.com>
Fri, 2 Oct 2015 06:45:28 +0000 (02:45 -0400)
Closes https://github.com/bagder/curl/pull/469

src/tool_setopt.c

index 7eb64b0397183adc8d889ed5b3e06541dcf8233c..2ed68e5eb3a7a4a8c9abc32840b6f77e32b3bd57 100644 (file)
@@ -227,7 +227,7 @@ static char *c_escape(const char *str)
       e += 2;
     }
     else if(! isprint(c)) {
-      snprintf(e, 4, "\\%03o", c);
+      snprintf(e, 5, "\\%03o", (unsigned)c);
       e += 4;
     }
     else