Avoid left shift of 32-bit value by more than 31
This commit is contained in:
@@ -261,7 +261,7 @@ int wxJoystick::GetButtonState() const
|
|||||||
|
|
||||||
bool wxJoystick::GetButtonState(unsigned id) const
|
bool wxJoystick::GetButtonState(unsigned id) const
|
||||||
{
|
{
|
||||||
if (id > sizeof(int) * 8)
|
if (id >= sizeof(int) * 8)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return (GetButtonState() & (1 << id)) != 0;
|
return (GetButtonState() & (1 << id)) != 0;
|
||||||
|
Reference in New Issue
Block a user