diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2022-08-08 10:42:54 +0200 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2022-08-08 10:42:54 +0200 |
commit | e35976f4a50f884c2162f71e4128d7c273e3e042 (patch) | |
tree | 06b9ecea83600701bcb29eb668f754825b002a16 | |
parent | 28fb3e28120db29ea45d1951eee7047b4109ab5f (diff) |
sync code-style patch from libsl
-rw-r--r-- | util.c | 23 |
1 files changed, 12 insertions, 11 deletions
@@ -6,18 +6,9 @@ | |||
6 | 6 | ||
7 | #include "util.h" | 7 | #include "util.h" |
8 | 8 | ||
9 | void * | ||
10 | ecalloc(size_t nmemb, size_t size) | ||
11 | { | ||
12 | void *p; | ||
13 | |||
14 | if (!(p = calloc(nmemb, size))) | ||
15 | die("calloc:"); | ||
16 | return p; | ||
17 | } | ||
18 | |||
19 | void | 9 | void |
20 | die(const char *fmt, ...) { | 10 | die(const char *fmt, ...) |
11 | { | ||
21 | va_list ap; | 12 | va_list ap; |
22 | 13 | ||
23 | va_start(ap, fmt); | 14 | va_start(ap, fmt); |
@@ -33,3 +24,13 @@ die(const char *fmt, ...) { | |||
33 | 24 | ||
34 | exit(1); | 25 | exit(1); |
35 | } | 26 | } |
27 | |||
28 | void * | ||
29 | ecalloc(size_t nmemb, size_t size) | ||
30 | { | ||
31 | void *p; | ||
32 | |||
33 | if (!(p = calloc(nmemb, size))) | ||
34 | die("calloc:"); | ||
35 | return p; | ||
36 | } | ||