about summary refs log tree commit diff
path: root/dmenu.c
diff options
context:
space:
mode:
authorS. Gilles <sgilles@math.umd.edu>2016-06-28 01:11:50 -0400
committerHiltjo Posthuma <hiltjo@codemadness.org>2016-06-28 17:51:28 +0200
commit76eb5783046cf89ba6b7e9f8cdab35fe86d07a82 (patch)
tree2d8d2ae771a654950d9f212e26ba792a1d8f3e88 /dmenu.c
parentimport new drw from libsl and minor fixes. (diff)
downloaddmenu-76eb5783046cf89ba6b7e9f8cdab35fe86d07a82.tar.gz
dmenu-76eb5783046cf89ba6b7e9f8cdab35fe86d07a82.tar.bz2
dmenu-76eb5783046cf89ba6b7e9f8cdab35fe86d07a82.zip
fix: Do not crash on e.g. dmenu < /dev/null
Diffstat (limited to '')
-rw-r--r--dmenu.c2
1 files changed, 1 insertions, 1 deletions
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);
 }