From 080c828a302c651267faea395e2eae8c782b6baa Mon Sep 17 00:00:00 2001 From: Bert Gijsbers Date: Sat, 3 Aug 2024 12:35:35 +0200 Subject: [PATCH] Enforce a limit of 8 mouse pointer buttons, as more is impossible. --- src/yconfig.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/yconfig.cc b/src/yconfig.cc index aa26d5bf1..98d1897d7 100644 --- a/src/yconfig.cc +++ b/src/yconfig.cc @@ -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; }