Fix off-by-one in button checking (fixes artf3861)

Change-Id: Ic3c33bf08417fef9c7432a19a419534b76cb8597
This commit is contained in:
Kevin O'Connor
2014-12-04 14:21:33 -05:00
parent 5893d28f39
commit 45f3b76103
2 changed files with 2 additions and 2 deletions

View File

@@ -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;
}