die() on calloc failure
authorHiltjo Posthuma <hiltjo@codemadness.org>
Sat, 5 Nov 2016 10:34:52 +0000 (11:34 +0100)
committerHiltjo Posthuma <hiltjo@codemadness.org>
Sat, 5 Nov 2016 10:34:52 +0000 (11:34 +0100)
thanks Markus Teich and David!

util.c

diff --git a/util.c b/util.c
index b0612af..fe044fc 100644 (file)
--- a/util.c
+++ b/util.c
@@ -12,7 +12,7 @@ ecalloc(size_t nmemb, size_t size)
        void *p;
 
        if (!(p = calloc(nmemb, size)))
-               perror(NULL);
+               die("calloc:");
        return p;
 }