summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-01-08 07:45:45 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-01-08 07:45:45 (GMT)
commit8f77fd4f0a73a92087b185af0b45d70607268107 (patch)
tree992c04083257689078f34ed228f0b89d6e0fcd24 /src
parentefde18ba4a4ec26d06682ac1b15d63f818f7ccfe (diff)
Fixed a bug in bitfield comparison.
Diffstat (limited to 'src')
-rw-r--r--src/common/bits.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/bits.c b/src/common/bits.c
index 7b49bb8..2714293 100644
--- a/src/common/bits.c
+++ b/src/common/bits.c
@@ -233,9 +233,9 @@ int compare_bit_fields(const bitfield_t *a, const bitfield_t *b)
else if (a->length < b->length)
result = -1;
- if (result == 0)
+ else
{
- final = a->length % sizeof(unsigned long);
+ final = a->length % (8 * sizeof(unsigned long));
if (final == 0)
final = ~0lu;