aboutsummaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorxyz <gky44px1999@gmail.com>2022-08-13 17:44:05 -0700
committerxyz <gky44px1999@gmail.com>2022-08-13 17:44:05 -0700
commitbe2066bc16fe63e6f60c81e9c17885949108cf45 (patch)
tree796b8b0cabbca3b2fc6f596a9d002218de83760b /util.c
parent571bfa337454f09fd13d9c5cd0f3ec5c85f4c41b (diff)
parent44adafe0069e73aa03a3829d7bb39591cd8b3f1d (diff)
Merge branch 'master' into fly
Diffstat (limited to 'util.c')
-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 @@
#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;
+}