From 46916ed93ba34558099590f33a5ed5ba6094353e Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 1 Nov 2014 09:42:05 +0100 Subject: evdev: avoid division by zero --- ftnoir_tracker_libevdev/ftnoir_tracker_libevdev.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ftnoir_tracker_libevdev/ftnoir_tracker_libevdev.cpp b/ftnoir_tracker_libevdev/ftnoir_tracker_libevdev.cpp index 6557eada..3e63e07d 100644 --- a/ftnoir_tracker_libevdev/ftnoir_tracker_libevdev.cpp +++ b/ftnoir_tracker_libevdev/ftnoir_tracker_libevdev.cpp @@ -57,6 +57,10 @@ void FTNoIR_Tracker::start_tracker(QFrame*) // no error checking here, errors result in SIGFPE a_min[i] = libevdev_get_abs_minimum(node, ot_libevdev_joystick_axes[i]); a_max[i] = libevdev_get_abs_maximum(node, ot_libevdev_joystick_axes[i]); + + if (a_min[i] == a_max[i]) + a_max[i]++; + qDebug() << "axis limits" << i << a_min[i] << "->" << a_max[i]; } -- cgit v1.2.3