From 6b3f11e2a3c85e2fc8e6239a3cda2320a99d3271 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 20 Aug 2018 21:18:56 -0700 Subject: [PATCH] Fixed code style --- src/joystick/SDL_joystick.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c index 2a5b90b0f..72c5656d2 100644 --- a/src/joystick/SDL_joystick.c +++ b/src/joystick/SDL_joystick.c @@ -582,12 +582,11 @@ SDL_JoystickFromInstanceID(SDL_JoystickID joyid) SDL_LockJoysticks(); for (joystick = SDL_joysticks; joystick; joystick = joystick->next) { if (joystick->instance_id == joyid) { - SDL_UnlockJoysticks(); - return joystick; + break; } } SDL_UnlockJoysticks(); - return NULL; + return joystick; } /*