summaryrefslogtreecommitdiff
path: root/debug.c
blob: 81d173c353f43cef4e32420f952cddec39f4a89b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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);
}