all repos — dmenu @ cd3b4915c3358b93f8dbff531bff82c0cd833c0b

my build of dmenu

helpful errors
Connor Lane Smith cls@lubutu.com
Fri, 06 May 2011 21:13:02 +0100
commit

cd3b4915c3358b93f8dbff531bff82c0cd833c0b

parent

210b303941e517a9d7df1cba1e3229165fb4037b

2 files changed, 8 insertions(+), 3 deletions(-)

jump to
M dmenu.cdmenu.c

@@ -440,9 +440,9 @@ for(end = &items; fgets(buf, sizeof buf, stdin); *end = item, end = &item->next) {

if((p = strchr(buf, '\n'))) *p = '\0'; if(!(item = calloc(1, sizeof *item))) - eprintf("cannot malloc %u bytes\n", sizeof *item); + eprintf("cannot malloc %u bytes:", sizeof *item); if(!(item->text = strdup(buf))) - eprintf("cannot strdup %u bytes\n", strlen(buf)+1); + eprintf("cannot strdup %u bytes:", strlen(buf)+1); inputw = MAX(inputw, textw(dc, item->text)); } }
M draw.cdraw.c

@@ -68,6 +68,11 @@ fprintf(stderr, "%s: ", progname);

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 @@

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