summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2022-08-08 10:42:54 +0200
committerrafa_99 <raroma09@gmail.com>2022-08-10 10:41:25 +0100
commitd53722bba369059c58fa771eaa95c4f95bfb7eba (patch)
treee3775d1b748ef927cda48673a249dcfd32c7697f /util.c
parent8e5318268a58ebefc08d4d5dd0ec4d3a00ab628a (diff)
sync code-style patch from libsl
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;
+}