mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-28 10:39:34 -05:00
Fix end conditions for tavl_end and tavl_next
This commit is contained in:
parent
a51cf20cea
commit
e840a34fef
1 changed files with 2 additions and 2 deletions
|
|
@ -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 a new issue