From aa69426670bf0ae480db127ff8d4fc62d6da2593 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Thu, 24 Jul 2014 19:10:23 +0000 Subject: fix crash with ctrl-enter as input reproduce: ./dmenu; send EOF; press ctrl+enter. --- dmenu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'dmenu.c') diff --git a/dmenu.c b/dmenu.c index dd2c128..b56f3a8 100644 --- a/dmenu.c +++ b/dmenu.c @@ -370,7 +370,8 @@ keypress(XKeyEvent *ev) { puts((sel && !(ev->state & ShiftMask)) ? sel->text : text); if(!(ev->state & ControlMask)) exit(EXIT_SUCCESS); - sel->out = True; + if(sel) + sel->out = True; break; case XK_Right: if(text[cursor] != '\0') { -- cgit v1.2.3-13-gbd6f