From: Guus Sliepen Date: Mon, 8 Jan 2001 21:32:00 +0000 (+0000) Subject: - Sign was wrong in search_closest_smaller/greater X-Git-Tag: release-1.0pre4~65 X-Git-Url: https://git.tinc-vpn.org/git/browse?a=commitdiff_plain;h=e5e1c20a99b0d72792f28e9a075a9f4a7e8b2c95;p=tinc - Sign was wrong in search_closest_smaller/greater --- diff --git a/lib/avl_tree.c b/lib/avl_tree.c index 34ce2a33..341ffeb6 100644 --- a/lib/avl_tree.c +++ b/lib/avl_tree.c @@ -29,7 +29,7 @@ library for inclusion into tinc (http://tinc.nl.linux.org) by Guus Sliepen . - $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 @@ -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); - if(result > 0) + if(result < 0) node = node->prev; 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); - if(result < 0) + if(result > 0) node = node->next; return node;