Commit 6b3f11e2a3c85e2fc8e6239a3cda2320a99d3271

Sam Lantinga 2018-08-20T21:18:56

Fixed code style

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c
index 2a5b90b..72c5656 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;
 }
 
 /*