Commit 60c6cd554d910b997150c63b2e626ed9c4e40d00

Sylvain 2022-11-17T09:34:27

Fixed bug #6533 - PS2_JoystickUpdate: some invalid condition

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/joystick/ps2/SDL_sysjoystick.c b/src/joystick/ps2/SDL_sysjoystick.c
index c43a1ef..3847d79 100644
--- a/src/joystick/ps2/SDL_sysjoystick.c
+++ b/src/joystick/ps2/SDL_sysjoystick.c
@@ -275,7 +275,7 @@ static void PS2_JoystickUpdate(SDL_Joystick *joystick)
     struct JoyInfo *info = &joyInfo[index];
     int state = padGetState(info->port, info->slot);
 
-    if (state != PAD_STATE_DISCONN || state != PAD_STATE_EXECCMD || state != PAD_STATE_ERROR) {
+    if (state != PAD_STATE_DISCONN && state != PAD_STATE_EXECCMD && state != PAD_STATE_ERROR) {
         int ret = padRead(info->port, info->slot, &buttons); /* port, slot, buttons */
         if (ret != 0) {
             /* Buttons */