Commit fa9c38e6 authored by Karl Fogel's avatar Karl Fogel

Fix warning about number of mouse buttons

Change a warning to distinguish between too few buttons and too many.

Before this change:

    $ xmodmap -e "pointer = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15"
    Warning: Only changing the first 15 of 10 buttons.
    $

After this change:

    $ xmodmap -e "pointer = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15"
    Warning: Not changing 5 extra buttons beyond 10.
    $

Fixes: #2Signed-off-by: Karl Fogel's avatarKarl Fogel <kfogel@red-bean.com>
parent c5a5fb06
......@@ -889,8 +889,16 @@ do_pointer(char *line, int len)
}
if (i > 0 && i != nbuttons) {
fprintf (stderr, "Warning: Only changing the first %d of %d buttons.\n",
i, nbuttons);
if (i < nbuttons) {
fprintf (stderr,
"Warning: Only changing the first %d of %d buttons.\n",
i, nbuttons);
}
else { /* i > nbuttons */
fprintf (stderr,
"Warning: Not changing %d extra buttons beyond %d.\n",
i - nbuttons, nbuttons);
}
i = nbuttons;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment