X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/agedu/blobdiff_plain/f4592adf2a5b6521f5dcf28c133fae48c6cd8828..aea73b94eceda699dd5208e2a78e39af7d6756d4:/trie.c diff --git a/trie.c b/trie.c index 4857891..d170458 100644 --- a/trie.c +++ b/trie.c @@ -218,7 +218,7 @@ static off_t triebuild_unwind(triebuild *tb, int targetdepth, int *outcount) while (depth > targetdepth) { int odepth = depth; while (depth > targetdepth && - (depth-1 > tb->switchsize || !tb->switches || + (depth-1 >= tb->switchsize || !tb->switches || tb->switches[depth-1].len == 0)) depth--; if (odepth > depth) {