diff options
Diffstat (limited to 'gnu/lib/libdialog/menubox.c')
-rw-r--r-- | gnu/lib/libdialog/menubox.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gnu/lib/libdialog/menubox.c b/gnu/lib/libdialog/menubox.c index 9a5b0c2..77b82ee 100644 --- a/gnu/lib/libdialog/menubox.c +++ b/gnu/lib/libdialog/menubox.c @@ -20,6 +20,9 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#ifndef lint +static const char rcsid[] = "$FreeBSD$"; +#endif #include <dialog.h> #include "dialog.priv.h" @@ -229,10 +232,10 @@ draw: } /* Check if key pressed matches first character of any item tag in menu */ - for (i = 0; i < max_choice; i++) - if (key < 0x100 && toupper(key) == toupper(items[(scroll + i) * 2][0])) + for (i = 0; i < max_choice; i++) + if (key < 0x100 && isprint(key) && toupper(key) == toupper(items[(scroll + i) * 2][0])) break; - + if (i < max_choice || (key >= '1' && key <= MIN('9', '0'+max_choice)) || KEY_IS_UP(key) || KEY_IS_DOWN(key)) { if (key >= '1' && key <= MIN('9', '0'+max_choice)) i = key - '1'; |