From 2fd839ae121a38aa5d404a1056daee5a83b18328 Mon Sep 17 00:00:00 2001 From: Quinn Date: Thu, 19 Jun 2025 18:18:31 +0200 Subject: [PATCH] fix: integer overflow when giving a small value as an argument --- src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index c4b7f44..e21ffb3 100644 --- a/src/main.c +++ b/src/main.c @@ -76,7 +76,7 @@ int main(int argc, char** argv) { ull msk = (1 << mod) - 1; // get a mask with the set word size int cnt = __builtin_popcountll(*n & msk); headsc += cnt; - tailsc += c - cnt; + tailsc += mod - cnt; } // print the results of this cycle