If the arguments to this function are only parseable up to a point,
the function prints a warning but still makes the (partial!) requested
change. For example, if the user runs:

xsetwacom --set 10 Button 1 "key +a notakeyword -a"

The program prints a warning about it not recognizing "notakeyword" and
maps Button 1 to "key +a". Instead of making partial changes, xsetwacom
should instead bail at the first sign of a problem.

Signed-off-by: Jason Gerecke <killert...@gmail.com>
---
 tools/xsetwacom.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/tools/xsetwacom.c b/tools/xsetwacom.c
index 130abb5..80766d1 100644
--- a/tools/xsetwacom.c
+++ b/tools/xsetwacom.c
@@ -1193,7 +1193,10 @@ static void special_map_property(Display *dpy, XDevice 
*dev, Atom btnact_prop, i
                }
 
                if (!keyword_found)
+               {
                        fprintf(stderr, "Cannot parse keyword '%s'\n", 
words[i]);
+                       return;
+               }
        }
 
        if (unset_prop || nitems > 0)
-- 
1.7.4.1


------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to