diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2022-08-08 10:42:54 +0200 |
---|---|---|
committer | rafa_99 <raroma09@gmail.com> | 2022-08-10 10:41:25 +0100 |
commit | d53722bba369059c58fa771eaa95c4f95bfb7eba (patch) | |
tree | e3775d1b748ef927cda48673a249dcfd32c7697f /util.c | |
parent | 8e5318268a58ebefc08d4d5dd0ec4d3a00ab628a (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; +} |