add prefix to reported errors

This commit is contained in:
Daniel Micay 2018-10-03 16:22:28 -04:00
parent 6372fee410
commit 6dfe33b4f1

2
util.c
View File

@ -6,6 +6,8 @@
#include "util.h"
COLD noreturn void fatal_error(const char *s) {
const char *prefix = "fatal allocator error: ";
write(STDERR_FILENO, prefix, strlen(prefix));
write(STDERR_FILENO, s, strlen(s));
write(STDERR_FILENO, "\n", 1);
abort();