mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Fix off-by-one in button checking (fixes artf3861)
Change-Id: Ic3c33bf08417fef9c7432a19a419534b76cb8597
This commit is contained in:
@@ -244,7 +244,7 @@ public class DriverStation implements RobotState.Interface {
|
||||
int buttons = FRCNetworkCommunicationsLibrary.HALGetJoystickButtons((byte)stick, countBuffer);
|
||||
byte count = 0;
|
||||
count = countBuffer.get();
|
||||
if(button >= count) {
|
||||
if(button > count) {
|
||||
reportJoystickUnpluggedError("WARNING: Joystick Button " + button + " on port " + stick + " not available, check if controller is plugged in\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user