path: root/advice.c
diff options
authorJeff King <>2012-07-23 18:48:57 (GMT)
committerJunio C Hamano <>2012-07-23 20:10:43 (GMT)
commit447b99c8b1102746054644acd268f4c1b115a9f8 (patch)
tree8a8eedaa50f8ccaf477d0341648dd0b8465a6bb1 /advice.c
parentd0f1ea6003d97e63110fa7d50bb07f546a909b6e (diff)
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 <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'advice.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/advice.c b/advice.c
index 65a0785..961a4f5 100644
--- a/advice.c
+++ b/advice.c
@@ -26,7 +26,7 @@ void advise(const char *advice, ...)
const char *cp, *np;
va_start(params, advice);
- strbuf_addf(&buf, advice, params);
+ strbuf_vaddf(&buf, advice, params);
for (cp = buf.buf; *cp; cp = np) {