diff options
Diffstat (limited to 'debug.c')
-rw-r--r-- | debug.c | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -0,0 +1,18 @@ +#include <stdio.h> +#include <stdlib.h> +#include <stdarg.h> + +#include "debug.h" + +void +_error(const char *file, const int line, const char *fmt, ...) +{ + va_list args; + fprintf(stderr, "%s:%d: ", file, line); + + va_start(args, fmt); + vfprintf(stderr, fmt, args); + va_end(args); + + exit(1); +} |