From e5e1c20a99b0d72792f28e9a075a9f4a7e8b2c95 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Mon, 8 Jan 2001 21:32:00 +0000 Subject: [PATCH] - Sign was wrong in search_closest_smaller/greater --- lib/avl_tree.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; -- 2.39.5