From cedf6c68dcb421953fc3a10879bd125b95e73187 Mon Sep 17 00:00:00 2001 From: khamidou Date: Tue, 3 Mar 2009 17:04:18 +0100 Subject: [PATCH] fixed variadic macro bug --- croma.c | 2 +- errors.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) 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); -- 2.43.0