From 76eb5783046cf89ba6b7e9f8cdab35fe86d07a82 Mon Sep 17 00:00:00 2001 From: "S. Gilles" Date: Tue, 28 Jun 2016 01:11:50 -0400 Subject: fix: Do not crash on e.g. dmenu < /dev/null --- dmenu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } -- cgit v1.2.3-13-gbd6f