[hackers] [dmenu] fix: Do not crash on e.g. dmenu < /dev/null || S. Gilles

From: <git_AT_suckless.org>
Date: Tue, 28 Jun 2016 17:58:37 +0200 (CEST)

commit 76eb5783046cf89ba6b7e9f8cdab35fe86d07a82
Author: S. Gilles <sgilles_AT_math.umd.edu>
AuthorDate: Tue Jun 28 01:11:50 2016 -0400
Commit: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
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
_AT_@ -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);
 }
 
Received on Tue Jun 28 2016 - 17:58:37 CEST

This archive was generated by hypermail 2.3.0 : Tue Jun 28 2016 - 18:00:17 CEST