From ecfbee98c5743a6f4926ec51c3fdbdf478966acb Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Sat, 18 Apr 2020 22:41:32 +0200 Subject: [PATCH] Fix an off-by-one error in key config menu When checking for user input in the keyboard config menu, a read past the end of the DebouncedKeyboardInput array returned a nonzero value on some systems, which prevented setting a valid binding. --- src/avp/win95/frontend/avp_menus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/avp/win95/frontend/avp_menus.c b/src/avp/win95/frontend/avp_menus.c index 4c654b3..63a3544 100644 --- a/src/avp/win95/frontend/avp_menus.c +++ b/src/avp/win95/frontend/avp_menus.c @@ -2270,7 +2270,7 @@ static void ActUponUsersInput(void) signed int key,selectedKey=-1; // see if a valid key has been pressed - for (key = 0 ; key <= MAX_NUMBER_OF_INPUT_KEYS ; key++) + for (key = 0 ; key < MAX_NUMBER_OF_INPUT_KEYS ; key++) { if (!(key == KEY_ESCAPE) && // !(key >= KEY_F1 && key <= KEY_F12) &&