From: Todd C. Miller Date: Wed, 27 May 2015 22:41:46 +0000 (-0600) Subject: Fix typo/thinko in static buffer conversion; use vsnprintf() not snprintf() X-Git-Tag: SUDO_1_8_14^2~101 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1100d91e8f72f265748d7deb09f8998e6bf92867;p=sudo Fix typo/thinko in static buffer conversion; use vsnprintf() not snprintf() --- diff --git a/lib/util/fatal.c b/lib/util/fatal.c index 66215bb5a..295cfe3c1 100644 --- a/lib/util/fatal.c +++ b/lib/util/fatal.c @@ -157,12 +157,12 @@ warning(int errnum, const char *fmt, va_list ap) /* Use static buffer if possible, else dynamic. */ va_copy(ap2, ap); - buflen = snprintf(static_buf, sizeof(static_buf), fmt, ap2); + buflen = vsnprintf(static_buf, sizeof(static_buf), fmt, ap2); va_end(ap2); if (buflen >= (int)sizeof(static_buf)) { buf = malloc(++buflen); if (buf != NULL) - (void)snprintf(buf, buflen, fmt, ap); + (void)vsnprintf(buf, buflen, fmt, ap); else buf = static_buf; }