aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Jay <dinkumator@gmail.com>2009-03-16 23:19:54 -0400
committerPeter Hutterer <peter.hutterer@who-t.net>2009-03-23 16:36:06 +1000
commit7e9809837c41a9ad0822a9bbc59362a3ba666696 (patch)
tree71eb2a2ffede5aeec873973462b4174f629438c5
parentAssume touchscreen/touchpad if we have _either_ ABS_PRESSURE or BTN_TOUCH (diff)
downloadxf86-input-evdev-7e9809837c41a9ad0822a9bbc59362a3ba666696.tar.gz
xf86-input-evdev-7e9809837c41a9ad0822a9bbc59362a3ba666696.tar.bz2
xf86-input-evdev-7e9809837c41a9ad0822a9bbc59362a3ba666696.zip
make sure to clear all axis_map entries
don't use uninitialized axis_map entries, ie axis_map[ABS_PRESSURE] Signed-off-by: Jeremy Jay <dinkumator@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 740dc202f735106532dce581deabe2b95c52759f)
-rw-r--r--src/evdev.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/evdev.c b/src/evdev.c
index 6ec7374..6aafce2 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -1136,12 +1136,17 @@ EvdevInitButtonMapping(InputInfoPtr pInfo)
static int
EvdevInit(DeviceIntPtr device)
{
+ int i;
InputInfoPtr pInfo;
EvdevPtr pEvdev;
pInfo = device->public.devicePrivate;
pEvdev = pInfo->private;
+ /* clear all axis_map entries */
+ for(i = 0; i < max(ABS_CNT,REL_CNT); i++)
+ pEvdev->axis_map[i]=-1;
+
if (pEvdev->flags & EVDEV_KEYBOARD_EVENTS)
EvdevAddKeyClass(device);
if (pEvdev->flags & EVDEV_BUTTON_EVENTS)