# HG changeset patch # User Michael Pavone # Date 1678431569 28800 # Node ID a1c9edf44c7ed0c32e753d7a5f5e4e1cf22e0cf3 # Parent 9d68799f945bdaaca5751352cfd4e713e37620c4 Fix a place I missed a problem from the SDL2 upgrade diff -r 9d68799f945b -r a1c9edf44c7e nuklear_ui/blastem_nuklear.c --- a/nuklear_ui/blastem_nuklear.c Thu Mar 09 22:49:42 2023 -0800 +++ b/nuklear_ui/blastem_nuklear.c Thu Mar 09 22:59:29 2023 -0800 @@ -927,17 +927,15 @@ memcpy(button_key + pad_key_size, button_base, sizeof(button_base)); char *final_key; - for (int i = 0; i < SDL_CONTROLLER_BUTTON_MAX; i++) + for (int i = 0; i <= SDL_CONTROLLER_BUTTON_MAX; i++) { char *base; const char *suffix; size_t base_key_len; - if ( i < SDL_CONTROLLER_BUTTON_DPAD_UP) { + if ( i < SDL_CONTROLLER_BUTTON_DPAD_UP || i > SDL_CONTROLLER_BUTTON_DPAD_RIGHT) { suffix = SDL_GameControllerGetStringForButton(i); base_key_len = button_key_size; base = button_key; - - } else { static const char *dir_keys[] = {"up", "down", "left", "right"}; suffix = dir_keys[i - SDL_CONTROLLER_BUTTON_DPAD_UP];