diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2022-08-08 10:43:09 +0200 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2022-08-08 10:43:09 +0200 |
commit | e0dee911455cee739a5b05a994828f4a37a2764d (patch) | |
tree | bd2adce4d88214ad679c02a71077bb73e39e8c49 /util.c | |
parent | 5e76e7e21da042c493c59235ca82d7275f20a7e4 (diff) |
sync code-style patch from libsl
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 23 |
1 files changed, 12 insertions, 11 deletions
@@ -6,18 +6,9 @@ #include "util.h" -void * -ecalloc(size_t nmemb, size_t size) -{ - void *p; - - if (!(p = calloc(nmemb, size))) - die("calloc:"); - return p; -} - void -die(const char *fmt, ...) { +die(const char *fmt, ...) +{ va_list ap; va_start(ap, fmt); @@ -33,3 +24,13 @@ die(const char *fmt, ...) { exit(1); } + +void * +ecalloc(size_t nmemb, size_t size) +{ + void *p; + + if (!(p = calloc(nmemb, size))) + die("calloc:"); + return p; +} |