X-Git-Url: https://git.danieliu.xyz/?p=dmenu.git;a=blobdiff_plain;f=util.c;h=fe044fc7b7978d1f3c23768e315aae415d90b11a;hp=6b703e9b8180fb32ce3e3e018a2bf0124748c797;hb=HEAD;hpb=5a20b409c673a6736c3f9326cb54edc32908f717 diff --git a/util.c b/util.c index 6b703e9..fe044fc 100644 --- a/util.c +++ b/util.c @@ -12,7 +12,7 @@ ecalloc(size_t nmemb, size_t size) void *p; if (!(p = calloc(nmemb, size))) - perror(NULL); + die("calloc:"); return p; } @@ -27,6 +27,8 @@ die(const char *fmt, ...) { if (fmt[0] && fmt[strlen(fmt)-1] == ':') { fputc(' ', stderr); perror(NULL); + } else { + fputc('\n', stderr); } exit(1);