Mac: Fixed off-by-one bug when plugging in a joystick (thanks, Konstantin!).

Ryan C. Gordon 2015-09-13 11:29:45 -04:00
parent 82c8825cb5
commit 4295a6fe47
1 changed files with 1 additions and 0 deletions

View File

@ -465,6 +465,7 @@ JoystickDeviceWasAddedCallback(void *ctx, IOReturn res, void *sender, IOHIDDevic
curdevice = curdevice->pNext; curdevice = curdevice->pNext;
} }
curdevice->pNext = device; curdevice->pNext = device;
++device_index; /* bump by one since we counted by pNext. */
} }
/* !!! FIXME: why isn't there an SDL_PrivateJoyDeviceAdded()? */ /* !!! FIXME: why isn't there an SDL_PrivateJoyDeviceAdded()? */