Avoid left shift of 32-bit value by more than 31

This commit is contained in:
Paul Cornett
2019-04-05 10:02:51 -07:00
parent 7cbe23830f
commit 9299f9f1d8

View File

@@ -261,7 +261,7 @@ int wxJoystick::GetButtonState() const
bool wxJoystick::GetButtonState(unsigned id) const
{
if (id > sizeof(int) * 8)
if (id >= sizeof(int) * 8)
return false;
return (GetButtonState() & (1 << id)) != 0;