diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2011-04-08 15:19:25 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-05-20 14:29:00 +1000 |
commit | 2dae1bbd3c5deb09ff36b2c7bcb805a441142caa (patch) | |
tree | 8aefc80abf2ecbd95a4f1e379021da96b0f30e55 /tools | |
parent | 15ed60a3211f80a8872c4b40ac73f051aca314ef (diff) | |
download | xf86-input-wacom-2dae1bbd3c5deb09ff36b2c7bcb805a441142caa.tar.gz |
xsetwacom: fix map_button indexing
Don't allow for button 0 to be map-able but allow for the last button to be
mapped.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/xsetwacom.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/xsetwacom.c b/tools/xsetwacom.c index 28d9e7a..11aea03 100644 --- a/tools/xsetwacom.c +++ b/tools/xsetwacom.c @@ -1490,11 +1490,11 @@ static void map_button_simple(Display *dpy, XDevice *dev, param_t* param, int bu int btn_no = 0; btn_no = get_button_number_from_string(param->name); - if (btn_no == -1) + if (btn_no <= 0) return; nmap = XGetDeviceButtonMapping(dpy, dev, map, nmap); - if (btn_no >= nmap) + if (btn_no > nmap) { fprintf(stderr, "Button number does not exist on device.\n"); return; |