diff options
-rw-r--r-- | src/hci/mucurses/kb.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/hci/mucurses/kb.c b/src/hci/mucurses/kb.c index 8face14d..a4b6ea87 100644 --- a/src/hci/mucurses/kb.c +++ b/src/hci/mucurses/kb.c @@ -103,7 +103,9 @@ int wgetnstr ( WINDOW *win, char *str, int n ) { _wcursback( win ); wdelch( win ); } else { - if ( c >= KEY_MIN ) { + if ( c >= 32 && c <= 126 ) { + *(_str++) = c; n--; + } else { switch(c) { case KEY_LEFT : case KEY_BACKSPACE : @@ -118,9 +120,6 @@ int wgetnstr ( WINDOW *win, char *str, int n ) { break; } } - if ( c >= 32 && c <= 126 ) { - *(_str++) = c; n--; - } } } |