From 6cadaf2eabb91e47963054e1628374861fea6209 Mon Sep 17 00:00:00 2001 From: Jason Gerecke Date: Wed, 11 Sep 2013 09:55:46 -0700 Subject: Correct return value of special_map_button The 'special_map_*' functions called by 'parse_actions' are expected to return a count of the number of words of input they have consumed. The 'special_map_buttom' function errounously returns the number of actions added instead, causing the program to potentially skip over requested actions which follow a list of "button" actions. Signed-off-by: Jason Gerecke --- tools/xsetwacom.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/xsetwacom.c b/tools/xsetwacom.c index b9b8a84..bbe25ea 100644 --- a/tools/xsetwacom.c +++ b/tools/xsetwacom.c @@ -1021,7 +1021,7 @@ static int special_map_button(Display *dpy, int argc, char **argv, unsigned long need_press = need_release = 1; if (sscanf(btn, "%d", &button) != 1) - return nitems; + break; TRACE("Button map %d [%s,%s]\n", abs(button), @@ -1044,7 +1044,7 @@ static int special_map_button(Display *dpy, int argc, char **argv, unsigned long } *ndata += nitems; - return nitems; + return i; } /* Return the first keycode to have the required keysym in the current group. -- cgit v1.2.1