1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-11-04 08:17:17 -05:00

terminal: Do not call toupper with potentially out-of-range values.

For instance, if Ctrl-F1 were pressed and src/terminal/kbd.c supported it,
then toupper(KBD_F1) would be called, resulting in undefined behaviour.
src/terminal/kbd.c does not support such combinations yet, but it is
safest to fix the bug already.
This commit is contained in:
Kalle Olavi Niemitalo 2006-08-05 13:30:00 +03:00 committed by Miciah Dashiel Butler Masters
parent 50603fc66c
commit 9e30ee631c

View File

@ -256,7 +256,7 @@ handle_interlink_event(struct terminal *term, struct term_event *ev)
reset_timer();
if (check_kbd_modifier(ev, KBD_MOD_CTRL) && toupper(key) == 'L') {
if (check_kbd_modifier(ev, KBD_MOD_CTRL) && (key == 'l' || key == 'L')) {
redraw_terminal_cls(term);
break;