src/joystick/hidapi/SDL_hidapi_xbox360.c
changeset 13840 df7f6873371a
parent 13758 dcf07006dda6
     1.1 --- a/src/joystick/hidapi/SDL_hidapi_xbox360.c	Wed May 20 16:59:35 2020 -0400
     1.2 +++ b/src/joystick/hidapi/SDL_hidapi_xbox360.c	Wed May 20 17:01:25 2020 -0400
     1.3 @@ -271,6 +271,8 @@
     1.4      int user_index;
     1.5      int match_count;
     1.6  
     1.7 +    *slot_idx = 0;
     1.8 +
     1.9      match_count = 0;
    1.10      for (user_index = 0; user_index < XUSER_MAX_COUNT; ++user_index) {
    1.11          if (!xinput_state[user_index].used && HIDAPI_DriverXbox360_XInputSlotMatches(state, user_index)) {
    1.12 @@ -1155,8 +1157,8 @@
    1.13          if (!ctx->xinput_correlated) {
    1.14              SDL_bool new_correlation_count = 0;
    1.15              if (HIDAPI_DriverXbox360_MissingXInputSlot()) {
    1.16 -                Uint8 correlation_id;
    1.17 -                Uint8 slot_idx;
    1.18 +                Uint8 correlation_id = 0;
    1.19 +                Uint8 slot_idx = 0;
    1.20                  if (HIDAPI_DriverXbox360_GuessXInputSlot(&match_state_xinput, &correlation_id, &slot_idx)) {
    1.21                      /* we match exactly one XInput device */
    1.22                      /* Probably can do without xinput_correlation_count, just check and clear xinput_slot to ANY, unless