Skip to content

Commit

Permalink
Enforce a limit of 8 mouse pointer buttons, as more is impossible.
Browse files Browse the repository at this point in the history
  • Loading branch information
gijsbers committed Aug 3, 2024
1 parent dce879b commit 080c828
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/yconfig.cc
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ KeySym YConfig::parseKeySym(const char* arg) {

if (strncmp(arg, "Pointer_Button", 14) == 0) {
int button = 0;
if (sscanf(arg + 14, "%d", &button) == 1 && 0 < button)
if (sscanf(arg + 14, "%d", &button) == 1 && inrange(button, 1, 8))
return button + XK_Pointer_Button1 - 1;
return NoSymbol;
}
Expand Down

0 comments on commit 080c828

Please sign in to comment.