From: Hiltjo Posthuma Date: Mon, 8 Aug 2022 08:43:09 +0000 (+0200) Subject: sync code-style patch from libsl X-Git-Url: https://git.atheridis.org/?a=commitdiff_plain;h=e0dee911455cee739a5b05a994828f4a37a2764d;p=suckless%2Fdwm.git sync code-style patch from libsl --- 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; +}