add prefix to reported errors

pull/50/head
Daniel Micay 2018-10-03 16:22:28 -04:00
parent 6372fee410
commit 6dfe33b4f1
1 changed files with 2 additions and 0 deletions

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();