diff --git a/src/screen_utils.c b/src/screen_utils.c
index 28d5e4b2fd4319384bf117178213f40f030485fa..891b9b3cb61bac1f673d1d45908712839d84f09d 100644 (file)
--- a/src/screen_utils.c
+++ b/src/screen_utils.c
flash();
}
+static bool
+ignore_key(int key)
+{
+ return key == ERR;
+}
+
int
screen_getch(const char *prompt)
{
curs_set(1);
int key;
- while ((key = wgetch(w)) == ERR)
- ;
+ while (ignore_key(key = wgetch(w))) {}
#ifdef HAVE_GETMOUSE
/* ignore mouse events */