aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2022-08-08 10:42:54 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2022-08-08 10:42:54 +0200
commite35976f4a50f884c2162f71e4128d7c273e3e042 (patch)
tree06b9ecea83600701bcb29eb668f754825b002a16
parent28fb3e28120db29ea45d1951eee7047b4109ab5f (diff)
sync code-style patch from libsl
-rw-r--r--util.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/util.c b/util.c
index fe044fc..96b82c9 100644
--- a/util.c
+++ b/util.c
@@ -6,18 +6,9 @@
6 6
7#include "util.h" 7#include "util.h"
8 8
9void *
10ecalloc(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
19void 9void
20die(const char *fmt, ...) { 10die(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
28void *
29ecalloc(size_t nmemb, size_t size)
30{
31 void *p;
32
33 if (!(p = calloc(nmemb, size)))
34 die("calloc:");
35 return p;
36}