diff options
Diffstat (limited to '8.1/error.c')
-rw-r--r-- | 8.1/error.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/8.1/error.c b/8.1/error.c new file mode 100644 index 0000000..85cd7f0 --- /dev/null +++ b/8.1/error.c @@ -0,0 +1,17 @@ +#include <stdio.h> +#include <stdarg.h> +#include <stdlib.h> +#include "error.h" + +void error(char *fmt, ...) +{ + va_list args; + va_start(args, fmt); + + fprintf(stderr, "error: "); + vfprintf(stderr, fmt, args); + fprintf(stderr, "\n"); + + va_end(args); + exit(1); +} |