applied reject no match patch
[dmenu.git] / util.c
diff --git a/util.c b/util.c
index 9b27512..fe044fc 100644 (file)
--- a/util.c
+++ b/util.c
@@ -6,6 +6,16 @@
 
 #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, ...) {
        va_list ap;
@@ -17,6 +27,8 @@ die(const char *fmt, ...) {
        if (fmt[0] && fmt[strlen(fmt)-1] == ':') {
                fputc(' ', stderr);
                perror(NULL);
+       } else {
+               fputc('\n', stderr);
        }
 
        exit(1);