From 31179739be8675f1414bfb66784170f2ba3d2b19 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 17 Sep 2014 15:58:34 +0100 Subject: Another case with repeating leaves. --- src/libutil/radix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/libutil') diff --git a/src/libutil/radix.c b/src/libutil/radix.c index 7efbadf3c..1445dd0fe 100644 --- a/src/libutil/radix.c +++ b/src/libutil/radix.c @@ -383,7 +383,7 @@ radix_compare_compressed (struct radix_compressed_node *node, /* Compare byte aligned levels of a compressed node */ shift = node->d.s.level / NBBY; - if (memcmp (node->d.s.key, key, shift) != 0) { + if (shift > 0 && memcmp (node->d.s.key, key, shift) != 0) { return FALSE; } @@ -391,7 +391,7 @@ radix_compare_compressed (struct radix_compressed_node *node, nk = node->d.s.key + shift; k = key + shift; rbits = node->d.s.level % NBBY; - bit = 1 << (7 - rbits); + bit = 1 << 7; while (rbits > 0) { if ((*nk & bit) != (*k & bit)) { -- cgit v1.2.3