diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-06-16 10:48:48 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-06-18 14:40:53 +1000 |
commit | 25b6fc4a42f7698e6ae0b16becb316bfd7835d05 (patch) | |
tree | a71b0dc2f0f65d2d8911bc7564c7371c1f306b75 /Xi/exevents.c | |
parent | 3fc762ea9474cf92f6b7ef60dd0bb68f59385272 (diff) |
Xi: last_valuator is used like an index, so range it accordingly.
The previous code would always skip the last valuator due to a wrong
upper boundary in the loop. last_valuator is the index of the last set
valuator - which also means it must be initialized to -1, not 0.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'Xi/exevents.c')
-rw-r--r-- | Xi/exevents.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c index 821644d55..0d8322a9d 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -818,7 +818,7 @@ UpdateDeviceState(DeviceIntPtr device, DeviceEvent* event) /* Update device axis */ /* Check valuators first */ - last_valuator = 0; + last_valuator = -1; for (i = 0; i < MAX_VALUATORS; i++) { if (BitIsOn(&event->valuators.mask, i)) @@ -838,7 +838,7 @@ UpdateDeviceState(DeviceIntPtr device, DeviceEvent* event) } } - for (i = 0; i < last_valuator && i < v->numAxes; i++) + for (i = 0; i <= last_valuator && i < v->numAxes; i++) { if (BitIsOn(&event->valuators.mask, i)) { |