diff --git a/test/testjoystick.c b/test/testjoystick.c index 4821e2b31..5c45eba38 100644 --- a/test/testjoystick.c +++ b/test/testjoystick.c @@ -321,6 +321,7 @@ main(int argc, char *argv[]) || (event.type == SDL_MOUSEBUTTONDOWN)) { keepGoing = SDL_FALSE; } else if (event.type == SDL_JOYDEVICEADDED) { + device = event.jdevice.which; joystick = SDL_JoystickOpen(device); if (joystick != NULL) { SDL_assert(SDL_JoystickFromInstanceID(SDL_JoystickInstanceID(joystick)) == joystick);