- Sign was wrong in search_closest_smaller/greater
This commit is contained in:
parent
11f3e9d138
commit
e5e1c20a99
1 changed files with 3 additions and 3 deletions
|
@ -29,7 +29,7 @@
|
||||||
library for inclusion into tinc (http://tinc.nl.linux.org) by
|
library for inclusion into tinc (http://tinc.nl.linux.org) by
|
||||||
Guus Sliepen <guus@sliepen.warande.net>.
|
Guus Sliepen <guus@sliepen.warande.net>.
|
||||||
|
|
||||||
$Id: avl_tree.c,v 1.1.2.3 2001/01/07 17:08:49 guus Exp $
|
$Id: avl_tree.c,v 1.1.2.4 2001/01/08 21:32:00 guus Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -383,7 +383,7 @@ avl_node_t *avl_search_closest_smaller_node(const avl_tree_t *tree, const void *
|
||||||
|
|
||||||
node = avl_search_closest_node(tree, data, &result);
|
node = avl_search_closest_node(tree, data, &result);
|
||||||
|
|
||||||
if(result > 0)
|
if(result < 0)
|
||||||
node = node->prev;
|
node = node->prev;
|
||||||
|
|
||||||
return node;
|
return node;
|
||||||
|
@ -396,7 +396,7 @@ avl_node_t *avl_search_closest_greater_node(const avl_tree_t *tree, const void *
|
||||||
|
|
||||||
node = avl_search_closest_node(tree, data, &result);
|
node = avl_search_closest_node(tree, data, &result);
|
||||||
|
|
||||||
if(result < 0)
|
if(result > 0)
|
||||||
node = node->next;
|
node = node->next;
|
||||||
|
|
||||||
return node;
|
return node;
|
||||||
|
|
Loading…
Reference in a new issue