summaryrefslogtreecommitdiff
path: root/dix/getevents.c
diff options
context:
space:
mode:
Diffstat (limited to 'dix/getevents.c')
-rw-r--r--dix/getevents.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/dix/getevents.c b/dix/getevents.c
index 82be5e9bc..9592d4cc5 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -728,9 +728,9 @@ static int
countValuatorEvents(int num_valuators)
{
if (num_valuators) {
- if ((num_valuators / 6) + 1 > MAX_VALUATOR_EVENTS)
- num_valuators = MAX_VALUATOR_EVENTS;
- return (num_valuators / 6) + 1;
+ if (((num_valuators - 1) / 6) + 1 > MAX_VALUATOR_EVENTS)
+ num_valuators = MAX_VALUATOR_EVENTS * 6;
+ return ((num_valuators - 1)/ 6) + 1;
} else
return 0;
}