From: S. Gilles Date: Tue, 28 Jun 2016 05:11:50 +0000 (-0400) Subject: fix: Do not crash on e.g. dmenu < /dev/null X-Git-Url: https://git.danieliu.xyz/?a=commitdiff_plain;h=76eb5783046cf89ba6b7e9f8cdab35fe86d07a82;p=dmenu.git fix: Do not crash on e.g. dmenu < /dev/null --- diff --git a/dmenu.c b/dmenu.c index 0e7b70b..e926eca 100644 --- a/dmenu.c +++ b/dmenu.c @@ -480,7 +480,7 @@ readstdin(void) } if (items) items[i].text = NULL; - inputw = TEXTW(items[imax].text); + inputw = items ? TEXTW(items[imax].text) : 0; lines = MIN(lines, i); }