aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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}