From 92a67a3a9425fec1fb6a388de65eb91f537df462 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Wed, 18 Jun 2014 14:22:24 +0200 Subject: [PATCH] touchpad: tp_current_touch: Fix off by one error Signed-off-by: Hans de Goede Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer --- src/evdev-mt-touchpad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c index 0294eb2b..92e0651a 100644 --- a/src/evdev-mt-touchpad.c +++ b/src/evdev-mt-touchpad.c @@ -139,7 +139,7 @@ tp_motion_history_reset(struct tp_touch *t) static inline struct tp_touch * tp_current_touch(struct tp_dispatch *tp) { - return &tp->touches[min(tp->slot, tp->ntouches)]; + return &tp->touches[min(tp->slot, tp->ntouches - 1)]; } static inline struct tp_touch * -- 2.34.1