1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-12-24 02:33:25 +01:00

Merge pull request #102 from graboy/master

Incorrectly handled error check for widechars
This commit is contained in:
JFreegman 2014-03-16 20:40:26 -04:00
commit 77db725822

View File

@ -393,14 +393,15 @@ void draw_active_window(Tox *m)
/* Handle input */ /* Handle input */
#ifdef HAVE_WIDECHAR #ifdef HAVE_WIDECHAR
wget_wch(stdscr, &ch); if (wget_wch(stdscr, &ch) == ERR)
#else #else
ch = getch(); if ((ch = getch()) == ERR)
#endif #endif
return;
if (ch == T_KEY_NEXT || ch == T_KEY_PREV) { if (ch == T_KEY_NEXT || ch == T_KEY_PREV) {
set_next_window((int) ch); set_next_window((int) ch);
} else if (ch != ERR) { } else {
pthread_mutex_lock(&Winthread.lock); pthread_mutex_lock(&Winthread.lock);
a->onKey(a, m, ch); a->onKey(a, m, ch);
pthread_mutex_unlock(&Winthread.lock); pthread_mutex_unlock(&Winthread.lock);