From 2aad1a2b42b7def7812abfa2462b6bcc6382e03a Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 2 Nov 2011 14:07:19 +1000 Subject: [PATCH] include: fix mask size calculation Same bug as inputproto-2.0.1-9-gb1149ab, if the XI2LASTEVENT was a multiple of 8, the mask was one bit too short. Signed-off-by: Peter Hutterer Reviewed-by: Daniel Stone Reviewed-by: Chase Douglas --- include/inputstr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/inputstr.h b/include/inputstr.h index 0a2128732..f482a2294 100644 --- a/include/inputstr.h +++ b/include/inputstr.h @@ -72,7 +72,7 @@ extern _X_EXPORT int CountBits(const uint8_t *mask, int len); * this number here is bumped. */ #define XI2LASTEVENT 17 /* XI_RawMotion */ -#define XI2MASKSIZE ((XI2LASTEVENT + 7)/8) /* no of bits for masks */ +#define XI2MASKSIZE ((XI2LASTEVENT >> 3) + 1) /* no of bytes for masks */ /** * Scroll types for ::SetScrollValuator and the scroll type in the