mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
ITS#5748: tavl_find3(NULL,,,) returned undefined data
This commit is contained in:
parent
a4598d1df7
commit
677a11ad26
@ -448,13 +448,13 @@ tavl_free( Avlnode *root, AVL_FREE dfree )
|
||||
/*
|
||||
* tavl_find2 - returns Avlnode instead of data pointer.
|
||||
* tavl_find3 - as above, but returns Avlnode even if no match is found.
|
||||
* also return the last comparison result in ret.
|
||||
* also set *ret = last comparison result, or -1 if root == NULL.
|
||||
*/
|
||||
Avlnode *
|
||||
tavl_find3( Avlnode *root, const void *data, AVL_CMP fcmp, int *ret )
|
||||
{
|
||||
int cmp, dir;
|
||||
Avlnode *prev;
|
||||
int cmp = -1, dir;
|
||||
Avlnode *prev = root;
|
||||
|
||||
while ( root != 0 && (cmp = (*fcmp)( data, root->avl_data )) != 0 ) {
|
||||
prev = root;
|
||||
|
Loading…
Reference in New Issue
Block a user