From 1100d91e8f72f265748d7deb09f8998e6bf92867 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Wed, 27 May 2015 16:41:46 -0600 Subject: [PATCH] Fix typo/thinko in static buffer conversion; use vsnprintf() not snprintf() --- lib/util/fatal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } -- 2.40.0