aboutsummaryrefslogtreecommitdiff
path: root/draw.c
diff options
context:
space:
mode:
authorConnor Lane Smith <cls@lubutu.com>2011-05-06 21:13:02 +0100
committerConnor Lane Smith <cls@lubutu.com>2011-05-06 21:13:02 +0100
commitcd3b4915c3358b93f8dbff531bff82c0cd833c0b (patch)
tree285f3515ff567d3b61da59229892909967f0c712 /draw.c
parent210b303941e517a9d7df1cba1e3229165fb4037b (diff)
downloaddmenu-cd3b4915c3358b93f8dbff531bff82c0cd833c0b.tar.gz
dmenu-cd3b4915c3358b93f8dbff531bff82c0cd833c0b.tar.bz2
dmenu-cd3b4915c3358b93f8dbff531bff82c0cd833c0b.zip
helpful errors
Diffstat (limited to 'draw.c')
-rw-r--r--draw.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/draw.c b/draw.c
index 80a5074..83ced4b 100644
--- a/draw.c
+++ b/draw.c
@@ -68,6 +68,11 @@ eprintf(const char *fmt, ...) {
va_start(ap, fmt);
vfprintf(stderr, fmt, ap);
va_end(ap);
+
+ if(fmt[strlen(fmt)-1] == ':') {
+ fputc(' ', stderr);
+ perror(NULL);
+ }
exit(EXIT_FAILURE);
}
@@ -101,7 +106,7 @@ initdc(void) {
if(!setlocale(LC_CTYPE, "") || !XSupportsLocale())
weprintf("no locale support\n");
if(!(dc = calloc(1, sizeof *dc)))
- eprintf("cannot malloc %u bytes\n", sizeof *dc);
+ eprintf("cannot malloc %u bytes:", sizeof *dc);
if(!(dc->dpy = XOpenDisplay(NULL)))
eprintf("cannot open display\n");