Mac: Fixed off-by-one bug when plugging in a joystick (thanks, Konstantin!).
diff --git a/src/joystick/darwin/SDL_sysjoystick.c b/src/joystick/darwin/SDL_sysjoystick.c
index 2b5f591..e9a028b 100644
--- a/src/joystick/darwin/SDL_sysjoystick.c
+++ b/src/joystick/darwin/SDL_sysjoystick.c
@@ -465,6 +465,7 @@ JoystickDeviceWasAddedCallback(void *ctx, IOReturn res, void *sender, IOHIDDevic
curdevice = curdevice->pNext;
}
curdevice->pNext = device;
+ ++device_index; /* bump by one since we counted by pNext. */
}
/* !!! FIXME: why isn't there an SDL_PrivateJoyDeviceAdded()? */