diff options
Diffstat (limited to 'error.c')
-rw-r--r-- | error.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -1,11 +1,15 @@ #include "error.h" +#include <stdarg.h> #include <stdio.h> #include <stdlib.h> -void fatal_error(const char *msg) +void fatal_error(const char *msgfmt, ...) { - perror(msg); + va_list args; + va_start(args, msgfmt); + vfprintf(stderr, msgfmt, args); + va_end(args); exit(-1); } |