X-Git-Url: https://git.danieliu.xyz/?p=dmenu.git;a=blobdiff_plain;f=util.c;fp=util.c;h=0427ed5a0c03c89319556a1ac2d903906f547d4f;hp=b7798d29f040fa57b4e91a4e86e7d0a85d96a4cf;hb=95b19f75cce1ba994790ccf7ccdf1815d5d52d75;hpb=3d25a327aad95e38ecd1642af58a49fc555a9d01 diff --git a/util.c b/util.c index b7798d2..0427ed5 100644 --- a/util.c +++ b/util.c @@ -18,15 +18,6 @@ emalloc(unsigned int size) { return res; } -char * -estrdup(const char *str) { - void *res = strdup(str); - - if(!res) - eprint("fatal: could not malloc() %u bytes\n", strlen(str)); - return res; -} - void eprint(const char *errstr, ...) { va_list ap; @@ -36,3 +27,12 @@ eprint(const char *errstr, ...) { va_end(ap); exit(EXIT_FAILURE); } + +char * +estrdup(const char *str) { + void *res = strdup(str); + + if(!res) + eprint("fatal: could not malloc() %u bytes\n", strlen(str)); + return res; +}