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

@@ -224,7 +224,7 @@ bool DriverStation::GetStickButton(uint32_t stick, uint8_t button)
}
HALJoystickButtons joystickButtons;
HALGetJoystickButtons(stick, &joystickButtons);
if(button >= joystickButtons.count)
if(button > joystickButtons.count)
{
ReportJoystickUnpluggedError("WARNING: Joystick Button missing, check if all controllers are plugged in\n");
return false;