Mac: Fixed off-by-one bug when plugging in a joystick (thanks, Konstantin!).
authorRyan C. Gordon <icculus@icculus.org>
Sun, 13 Sep 2015 11:29:45 -0400
changeset 9862 c3c3cdaf37f9
parent 9861 2117766ff8d2
child 9863 334d18fb5dd1
Mac: Fixed off-by-one bug when plugging in a joystick (thanks, Konstantin!).
src/joystick/darwin/SDL_sysjoystick.c
--- a/src/joystick/darwin/SDL_sysjoystick.c	Wed Sep 09 19:08:52 2015 -0300
+++ b/src/joystick/darwin/SDL_sysjoystick.c	Sun Sep 13 11:29:45 2015 -0400
@@ -465,6 +465,7 @@
             curdevice = curdevice->pNext;
         }
         curdevice->pNext = device;
+        ++device_index;  /* bump by one since we counted by pNext. */
     }
 
 /* !!! FIXME: why isn't there an SDL_PrivateJoyDeviceAdded()? */