mirror of
https://github.com/ApfelTeeSaft/vanilla.git
synced 2026-08-26 19:33:44 +00:00
gui: check for nullptr on controller name strcmp (#297)
This commit is contained in:
+1
-1
@@ -166,7 +166,7 @@ void find_valid_controller(vui_sdl_context_t *sdl_ctx)
|
||||
for (int i = 0; i < SDL_NumJoysticks(); i++) {
|
||||
const char *ctrl_name = SDL_GameControllerNameForIndex(i);
|
||||
vpilog(" Found %i: %s\n", i, ctrl_name);
|
||||
if (!strcmp(ctrl_name, "Steam Virtual Gamepad")) {
|
||||
if (ctrl_name != NULL && !strcmp(ctrl_name, "Steam Virtual Gamepad")) {
|
||||
steam_virtual_gamepad_index = i;
|
||||
} else if (controller == -1) {
|
||||
controller = i;
|
||||
|
||||
Reference in New Issue
Block a user