mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-30 13:30:57 +08:00
Fix end conditions for tavl_end and tavl_next
This commit is contained in:
parent
a51cf20cea
commit
e840a34fef
@ -475,7 +475,7 @@ Avlnode *
|
||||
tavl_end( Avlnode *root, int dir )
|
||||
{
|
||||
if ( root ) {
|
||||
while ( root->avl_bits[dir] == AVL_CHILD )
|
||||
while ( root->avl_bits[dir] == AVL_CHILD && root->avl_link[dir] )
|
||||
root = root->avl_link[dir];
|
||||
}
|
||||
return root;
|
||||
@ -491,7 +491,7 @@ tavl_next( Avlnode *root, int dir )
|
||||
root = root->avl_link[dir];
|
||||
if ( c == AVL_CHILD ) {
|
||||
dir ^= 1;
|
||||
while ( root->avl_bits[dir] == AVL_CHILD )
|
||||
while ( root && root->avl_bits[dir] == AVL_CHILD )
|
||||
root = root->avl_link[dir];
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user