Make XInput joystick names match the numbers on the device.
authorRyan C. Gordon <icculus@icculus.org>
Wed, 28 Aug 2013 17:17:21 -0400
changeset 7709 edd2c14acf66
parent 7708 d5aa9910b1f7
child 7710 6364d6836634
Make XInput joystick names match the numbers on the device. (And how the Haptic code already names them.)
src/joystick/windows/SDL_dxjoystick.c
--- a/src/joystick/windows/SDL_dxjoystick.c	Wed Aug 28 17:12:07 2013 -0400
+++ b/src/joystick/windows/SDL_dxjoystick.c	Wed Aug 28 17:17:21 2013 -0400
@@ -745,7 +745,7 @@
     }
     SDL_zerop(pNewJoystick);
 
-    SDL_snprintf(name, sizeof (name), "XInput Controller #%d", (int) userid);
+    SDL_snprintf(name, sizeof (name), "XInput Controller #%u", ((unsigned int) userid) + 1);
     pNewJoystick->joystickname = SDL_strdup(name);
     if (!pNewJoystick->joystickname) {
         SDL_free(pNewJoystick);