X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=main.c;h=b9b62e1e77d2a2395f41e99aed641cebb38d0f6d;hb=5415928cc4c29c1754b6562bad26ab7d7f23882d;hp=ce9526b0b8d2541809c1eb0c34e643811a6f4656;hpb=3a914cb54f693ab22cbaa1778392eab8f938aefc;p=cparser diff --git a/main.c b/main.c index ce9526b..b9b62e1 100644 --- a/main.c +++ b/main.c @@ -231,24 +231,28 @@ static void lextest(FILE *in, const char *fname) do { lexer_next_preprocessing_token(); print_token(stdout, &lexer_token); - puts(""); + putchar('\n'); } while (lexer_token.type != T_EOF); } static void add_flag(struct obstack *obst, const char *format, ...) { - obstack_1grow(obst, ' '); -#ifdef _WIN32 - obstack_1grow(obst, '"'); - obstack_vprintf(obst, format, ap); - obstack_1grow(obst, '"'); -#else char buf[4096]; va_list ap; + va_start(ap, format); - vsnprintf(buf, sizeof(buf), format, ap); +#ifdef _WIN32 + int len = +#endif + vsnprintf(buf, sizeof(buf), format, ap); va_end(ap); + obstack_1grow(obst, ' '); +#ifdef _WIN32 + obstack_1grow(obst, '"'); + obstack_grow(obst, buf, len); + obstack_1grow(obst, '"'); +#else /* escape stuff... */ for (char *c = buf; *c != '\0'; ++c) { switch(*c) {