From a057243ef11e64a9659ff5f5a96cd3b14777dafc Mon Sep 17 00:00:00 2001 From: Tharre Date: Mon, 24 Nov 2014 21:47:23 +0100 Subject: Rename diem to fatal to further confuse matters. It's actually pretty easy now, fatal() is used as a short cut for appending the strerror'd errno, while die() is just the generic version of printing errors that behaves just like fprintf(stderr, msg) + exit(). --- src/util.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/util.c') diff --git a/src/util.c b/src/util.c index c667a1b..a871588 100644 --- a/src/util.c +++ b/src/util.c @@ -36,7 +36,7 @@ void *xmalloc(size_t size) { assert(size > 0); void *ptr = malloc(size); if (!ptr) - diem("Cannot allocate %zu bytes", size); + fatal("Cannot allocate %zu bytes", size); return ptr; } @@ -44,7 +44,7 @@ void *xmalloc(size_t size) { void *xrealloc(void *ptr, size_t size) { assert(size > 0 && ptr); if (!(ptr = realloc(ptr, size))) - diem("Cannot reallocate %zu bytes", size); + fatal("Cannot reallocate %zu bytes", size); return ptr; } @@ -52,7 +52,7 @@ void *xrealloc(void *ptr, size_t size) { char *xstrdup(const char *str) { assert(str); if (!(str = strdup(str))) - diem("Insufficient memory for string allocation"); + fatal("Insufficient memory for string allocation"); return (char*) str; } -- cgit v1.2.3-70-g09d2