From e6c68143bdd6b2753a47eeb9b1d91885743cb3b5 Mon Sep 17 00:00:00 2001 From: Grayson MacKenzie Date: Sun, 16 Mar 2014 20:18:31 -0400 Subject: [PATCH] Fixed incorrectly handled error check for longchars --- src/windows.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/windows.c b/src/windows.c index 6961789..2c3024d 100644 --- a/src/windows.c +++ b/src/windows.c @@ -393,14 +393,15 @@ void draw_active_window(Tox *m) /* Handle input */ #ifdef HAVE_WIDECHAR - wget_wch(stdscr, &ch); + if (wget_wch(stdscr, &ch) == ERR) #else - ch = getch(); + if ((ch = getch()) == ERR) #endif + return; if (ch == T_KEY_NEXT || ch == T_KEY_PREV) { set_next_window((int) ch); - } else if (ch != ERR) { + } else { pthread_mutex_lock(&Winthread.lock); a->onKey(a, m, ch); pthread_mutex_unlock(&Winthread.lock);