diff options
author | Tharre <tharre3@gmail.com> | 2014-11-24 21:47:23 +0100 |
---|---|---|
committer | Tharre <tharre3@gmail.com> | 2014-11-24 21:47:23 +0100 |
commit | a057243ef11e64a9659ff5f5a96cd3b14777dafc (patch) | |
tree | 1e9e86ef59db58e0857922367ab772e095fa4e5a /src/util.c | |
parent | f907d26292168cd9ba8900f3deec513c257c4ffc (diff) | |
download | redo-a057243ef11e64a9659ff5f5a96cd3b14777dafc.tar.gz redo-a057243ef11e64a9659ff5f5a96cd3b14777dafc.tar.xz redo-a057243ef11e64a9659ff5f5a96cd3b14777dafc.zip |
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().
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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; } |