From: Linus Torvalds Date: Mon, 11 Apr 2005 20:53:49 +0000 (-0700) Subject: Fix "usage()" to do the missing line termination. X-Git-Tag: v0.99~916 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=0dcad32ae239906217065b6a2b0fca41962e5d57;p=git.git Fix "usage()" to do the missing line termination. It got broken when I changed it to use stdarg. --- diff --git a/read-cache.c b/read-cache.c index 51403cea..3c575f7d 100644 --- a/read-cache.c +++ b/read-cache.c @@ -12,10 +12,12 @@ unsigned int active_nr = 0, active_alloc = 0; void usage(const char *err, ...) { va_list args; + char string[200]; va_start(args, err); - vfprintf(stderr, err, args); + vsnprintf(string, sizeof(string), err, args); va_end(args); + fprintf(stderr, "%s\n", string); exit(1); }