From af14d00d17c0be75ec3fd8fac1011064ac40b54b Mon Sep 17 00:00:00 2001 From: Kalle Olavi Niemitalo Date: Mon, 3 Sep 2007 20:53:27 +0300 Subject: [PATCH] Add missing va_ends. I'm not sure they're needed anywhere nowadays, but still. --- src/util/string.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/util/string.c b/src/util/string.c index c3c953fad..076c491b8 100644 --- a/src/util/string.c +++ b/src/util/string.c @@ -445,7 +445,6 @@ add_format_to_string(struct string *string, const unsigned char *format, ...) int newlength; int width; va_list ap; - va_list ap2; assertm(string && format, "[add_format_to_string]"); if_assert_failed { return NULL; } @@ -453,17 +452,16 @@ add_format_to_string(struct string *string, const unsigned char *format, ...) check_string_magic(string); va_start(ap, format); - VA_COPY(ap2, ap); - - width = vsnprintf(NULL, 0, format, ap2); + width = vsnprintf(NULL, 0, format, ap); + va_end(ap); if (width <= 0) return NULL; newlength = string->length + width; if (!realloc_string(string, newlength)) return NULL; + va_start(ap, format); vsnprintf(&string->source[string->length], width + 1, format, ap); - va_end(ap); string->length = newlength;