X-Git-Url: https://git.xinqibao.xyz/dwm.git/blobdiff_plain/646b351cc79845f4cc77415dfff474b9ae0053d9..bb2e7222baeec7776930354d0e9f210cc2aaad5f:/util.c?ds=sidebyside

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);