commit 76eb5783046cf89ba6b7e9f8cdab35fe86d07a82
Author:     S. Gilles <[email protected]>
AuthorDate: Tue Jun 28 01:11:50 2016 -0400
Commit:     Hiltjo Posthuma <[email protected]>
CommitDate: Tue Jun 28 17:51:28 2016 +0200

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

Reply via email to