From 79c6f528c76905104d20dd5e41d1117d713492e1 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Wed, 19 Nov 2008 12:24:55 +0000 Subject: [PATCH] Counter-fix add_flag(). [r23811] --- main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/main.c b/main.c index 80817de..b9b62e1 100644 --- a/main.c +++ b/main.c @@ -239,19 +239,20 @@ static void add_flag(struct obstack *obst, const char *format, ...) { char buf[4096]; va_list ap; + va_start(ap, format); +#ifdef _WIN32 + int len = +#endif + vsnprintf(buf, sizeof(buf), format, ap); + va_end(ap); obstack_1grow(obst, ' '); #ifdef _WIN32 obstack_1grow(obst, '"'); - int len = vsnprintf(buf, sizeof(buf), format, ap); obstack_grow(obst, buf, len); obstack_1grow(obst, '"'); #else - char buf[4096]; - vsnprintf(buf, sizeof(buf), format, ap); - va_end(ap); - /* escape stuff... */ for (char *c = buf; *c != '\0'; ++c) { switch(*c) { @@ -274,7 +275,6 @@ static void add_flag(struct obstack *obst, const char *format, ...) } } #endif - va_end(ap); } static const char *type_to_string(type_t *type) -- 2.20.1