Lines 76-85
Link Here
|
76 |
|
76 |
|
77 |
XGetDeviceButtonMapping(display, device, map, nbuttons); |
77 |
XGetDeviceButtonMapping(display, device, map, nbuttons); |
78 |
|
78 |
|
79 |
min = (argc > nbuttons + 1) ? nbuttons + 1 : argc; |
79 |
min = (argc - 2 > nbuttons) ? nbuttons : argc - 2; |
80 |
|
80 |
|
81 |
for(idx=1; idx < min; idx++) { |
81 |
for(idx = 0; idx < min; idx++) { |
82 |
map[idx - 1] = atoi(argv[idx]); |
82 |
map[idx] = atoi(argv[idx + 2]); |
83 |
} |
83 |
} |
84 |
XSetDeviceButtonMapping(display, device, map, nbuttons); |
84 |
XSetDeviceButtonMapping(display, device, map, nbuttons); |
85 |
XCloseDevice(display, device); |
85 |
XCloseDevice(display, device); |