X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=main.c;h=b9b62e1e77d2a2395f41e99aed641cebb38d0f6d;hb=5415928cc4c29c1754b6562bad26ab7d7f23882d;hp=80817deeacb15e5cfc059fe91df58a53ff7b7e3f;hpb=7a158e8c2de8ed37c9e589a207bfb1e8f9d92a8d;p=cparser 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)