diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2015-10-20 22:51:57 +0200 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2015-10-20 22:51:57 +0200 |
commit | 5a20b409c673a6736c3f9326cb54edc32908f717 (patch) | |
tree | 9b30985369ab49bd7588127411d9cf2209f19efb /util.c | |
parent | 164986763a29db97abb52b15cbd282b5636d83c0 (diff) |
add sbase-style ecalloc(), calloc: or die
... remove intermediary variables
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -6,6 +6,16 @@ #include "util.h" +void * +ecalloc(size_t nmemb, size_t size) +{ + void *p; + + if (!(p = calloc(nmemb, size))) + perror(NULL); + return p; +} + void die(const char *fmt, ...) { va_list ap; |