From 9e30ee631ced843f26a264c351cfa1716e7e1941 Mon Sep 17 00:00:00 2001 From: Kalle Olavi Niemitalo Date: Sat, 5 Aug 2006 13:30:00 +0300 Subject: [PATCH] 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. --- src/terminal/event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/terminal/event.c b/src/terminal/event.c index 71f3950e..2032e0eb 100644 --- a/src/terminal/event.c +++ b/src/terminal/event.c @@ -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;