joy.cpl: Display the correct number of button boxes during test

Bruno Jesus 00cpxxx at gmail.com
Fri Jul 22 19:50:33 CDT 2016


After testing with an 8 button only joystick I noticed that currently
the program displays 9 buttons. Then I tested with an PS2 + usb
adapter controller and noticed that it is also off by one. I believe
nobody notices this because the gamepads have too many buttons
nowadays and you never test all of them.

Signed-off-by: Bruno Jesus <00cpxxx at gmail.com>
-------------- next part --------------
diff --git a/dlls/joy.cpl/main.c b/dlls/joy.cpl/main.c
index d6ba5d5..b5a55fa 100644
--- a/dlls/joy.cpl/main.c
+++ b/dlls/joy.cpl/main.c
@@ -457,7 +457,7 @@ static void test_handle_joychange(HWND hwnd, struct JoystickData *data)
 
     /* Enable only  buttons present in the device */
     for (i = 0; i < TEST_MAX_BUTTONS; i++)
-        ShowWindow(data->graphics.buttons[i], i <= data->joysticks[data->chosen_joystick].num_buttons);
+        ShowWindow(data->graphics.buttons[i], i < data->joysticks[data->chosen_joystick].num_buttons);
 }
 
 /*********************************************************************


More information about the wine-patches mailing list