aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiltjo Posthuma2022-08-08 10:42:54 +0200
committerHiltjo Posthuma2022-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 @@
#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;
+}