diff options
| author | ozpv <39195175+ozpv@users.noreply.github.com> | 2024-03-03 19:53:06 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-03 19:53:06 +0000 |
| commit | 43e54b66235e89e2ba2f16b70a00f56a2ef04d57 (patch) | |
| tree | 973a8a3a666218bb2bdd30e90b80036ab734f33d /util.c | |
| parent | dd471a8ff3c9cf006098a95583f181c6859b3c0d (diff) | |
update to 5.2
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; +} |
