aboutsummaryrefslogtreecommitdiffstats
path: root/src/keys.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/keys.c')
-rw-r--r--src/keys.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/keys.c b/src/keys.c
index 68eca76..4e608c7 100644
--- a/src/keys.c
+++ b/src/keys.c
@@ -247,8 +247,12 @@ int keys_wgetch(WINDOW *win)
int ch, i;
char buf[UTF8_MAXLEN];
+ ch = wgetch(win);
+ if (ch == ERR)
+ return ch;
+
/* Handle curses pseudo characters. */
- if ((ch = wgetch(win)) >= KEY_MIN)
+ if (ch >= KEY_MIN)
return ch;
/* Handle 1-byte UTF-8 characters. */