From e6e6479710b0a00218437753cf816bf68c99f8ab Mon Sep 17 00:00:00 2001
From: Cyrille Bagard <nocbos@gmail.com>
Date: Fri, 4 Jan 2019 20:09:13 +0100
Subject: Fixed the popcount feature of bitfields.

---
 src/common/bits.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/common/bits.c b/src/common/bits.c
index 32041b9..7b49bb8 100644
--- a/src/common/bits.c
+++ b/src/common/bits.c
@@ -582,7 +582,7 @@ size_t popcount_for_bit_field(const bitfield_t *field)
         value = field->bits[i];
 
         if (remaining < (8 * sizeof(unsigned long)))
-            value &= (1lu << (remaining + 1)) - 1;
+            value &= (1lu << remaining) - 1;
 
 #if __WORDSIZE == 64
         result += popcount_64(value);
-- 
cgit v0.11.2-87-g4458