mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 10:14:52 +00:00
test/xi2: Fix infinite loop in test_convert_XITouchOwnershipEvent
The touchid test was using a loop like: for(i = 1; i < 0xffffffff; i <<= 1) When 'i' is a 32-bit variable, this infinite loops as it goes from 0x80000000 to 0. 'i' is declared as 'long', which is 32-bit in 32-bit mode. Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
@@ -1001,10 +1001,12 @@ test_convert_XITouchOwnershipEvent(void)
|
||||
test_XITouchOwnershipEvent(&in);
|
||||
}
|
||||
|
||||
for (i = 1; i <= 0xFFFFFFFF; i <<= 1)
|
||||
for (i = 1; ; i <<= 1)
|
||||
{
|
||||
in.touchid = i;
|
||||
test_XITouchOwnershipEvent(&in);
|
||||
if (i == (1 << 31))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user