summaryrefslogtreecommitdiff
path: root/Xi/xiquerypointer.c
diff options
context:
space:
mode:
Diffstat (limited to 'Xi/xiquerypointer.c')
-rw-r--r--Xi/xiquerypointer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Xi/xiquerypointer.c b/Xi/xiquerypointer.c
index 2222873aa..da1d101cb 100644
--- a/Xi/xiquerypointer.c
+++ b/Xi/xiquerypointer.c
@@ -126,7 +126,7 @@ ProcXIQueryPointer(ClientPtr client)
if (pDev->button)
{
int i, down;
- rep.buttons_len = (((pDev->button->numButtons + 7)/8) + 3)/4;
+ rep.buttons_len = bytes_to_int32(bits_to_bytes(pDev->button->numButtons));
rep.length += rep.buttons_len;
buttons = xcalloc(rep.buttons_len, 4);
if (!buttons)