From: khamidou Date: Tue, 3 Mar 2009 16:04:18 +0000 (+0100) Subject: fixed variadic macro bug X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=cedf6c68dcb421953fc3a10879bd125b95e73187;p=croma.git fixed variadic macro bug --- diff --git a/croma.c b/croma.c index 48238fd..39870d3 100644 --- a/croma.c +++ b/croma.c @@ -15,7 +15,7 @@ int main(int argc, char **argv) if (argc == 2) { yyin = fopen(argv[1], "r"); if (yyin == NULL) - fail("Unable to open file : %s"); + fail("Unable to open file : %s\n", argv[1]); } init_parser(); diff --git a/errors.c b/errors.c index ac7b305..3ef3996 100644 --- a/errors.c +++ b/errors.c @@ -1,12 +1,11 @@ #include "errors.h" + void fail(char *fmt, ...) { va_list ap; va_start(ap, fmt); - - fprintf(stderr, fmt, ap); - + vfprintf(stderr, fmt, ap); va_end(ap); exit(EXIT_FAILURE);