advice: pass varargs to strbuf_vaddf, not strbuf_addf
The advise() function takes a variable number of arguments and converts them into a va_list object to pass to strbuf for handling. However, we accidentally called strbuf_addf (that takes a variable number of arguments) instead of strbuf_vaddf (that takes a va_list). This bug dates back to v1.7.8.1-1-g23cb5bf, but we never noticed because none of the current callers passes a string with a format specifier in it. And the compiler did not notice because the format string is not available at compile time. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King committed
Jul 23, 2012 at 14:48 UTC
447b99c8b1102746054644acd268f4c1b115a9f8
1 file changed
+1
-1
advice.c
+1
-1
@@ -26,7 +26,7 @@ void advise(const char *advice, ...)
26
const char *cp, *np;
27
28
va_start(params, advice);
29
- strbuf_addf(&buf, advice, params);
29
+ strbuf_vaddf(&buf, advice, params);
30
va_end(params);
31
32
for (cp = buf.buf; *cp; cp = np) {