From 2d3fb8efc7c6abb70123d866b433059b8bac4963 Mon Sep 17 00:00:00 2001 From: semickolon Date: Thu, 4 Jan 2024 20:37:24 +0800 Subject: [PATCH] Prevent strong mods ref counter from underflowing --- src/split_central.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/split_central.c b/src/split_central.c index 48a27bf..68c854e 100644 --- a/src/split_central.c +++ b/src/split_central.c @@ -78,7 +78,7 @@ static void register_mods(uint8_t mods, uint8_t down) { if (mods & (1 << i)) { if (down) { strong_mods_ref_count[i] += 1; - } else { + } else if (strong_mods_ref_count[i] > 0) { strong_mods_ref_count[i] -= 1; } }