From b515b34dbb92ca04f1aca04c8271ae51405d92ba Mon Sep 17 00:00:00 2001 From: Philipp Wiesemann Date: Fri, 16 Dec 2016 22:58:32 +0100 Subject: [PATCH] Fixed hotplug with more than one device in testjoystick program. --- test/testjoystick.c | 1 + 1 file changed, 1 insertion(+) 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);