diff options
author | Krow Savcik <krow@savcik.xyz> | 2025-08-31 15:11:01 +0200 |
---|---|---|
committer | Krow Savcik <krow@savcik.xyz> | 2025-08-31 15:11:01 +0200 |
commit | 0fa7537ce5006a9c99bc7e295a4ae4ff0b920fda (patch) | |
tree | 057a91b30ab61417970c5defe825ce16a094ac39 /debug.c |
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); +} |