mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03:00
Add check for converting negative SDL_GameControllerButton to glyph
A SDL_GameControllerButton below 0 is out of array bounds, so that should trip the assert and return GLYPH_UNKNOWN just like when the value is too high.
This commit is contained in:
@@ -274,7 +274,7 @@ const char* BUTTONGLYPHS_get_wasd_text(void)
|
|||||||
|
|
||||||
const char* BUTTONGLYPHS_sdlbutton_to_glyph(const SDL_GameControllerButton button)
|
const char* BUTTONGLYPHS_sdlbutton_to_glyph(const SDL_GameControllerButton button)
|
||||||
{
|
{
|
||||||
if (button > SDL_CONTROLLER_BUTTON_RIGHTSHOULDER)
|
if (button < 0 || button > SDL_CONTROLLER_BUTTON_RIGHTSHOULDER)
|
||||||
{
|
{
|
||||||
SDL_assert(0 && "Unhandled button!");
|
SDL_assert(0 && "Unhandled button!");
|
||||||
return glyph[GLYPH_UNKNOWN];
|
return glyph[GLYPH_UNKNOWN];
|
||||||
|
|||||||
Reference in New Issue
Block a user