X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=lib%2Favl_tree.c;h=341ffeb63e77a396f220c7814512981700e09d52;hp=df7a0361983eef50d2060ebdd786c07d5b9a3ca8;hb=e5e1c20a99b0d72792f28e9a075a9f4a7e8b2c95;hpb=77509da76c61b881c9967bfb7cdafeaf6b56eb6d diff --git a/lib/avl_tree.c b/lib/avl_tree.c index df7a0361..341ffeb6 100644 --- a/lib/avl_tree.c +++ b/lib/avl_tree.c @@ -1,23 +1,23 @@ /* avl_tree.c -- avl_ tree and linked list convenience Copyright (C) 1998 Michael H. Buselli - 2000 Ivo Timmermans , - 2000 Guus Sliepen - 2000 Wessel Dankers + 2000,2001 Ivo Timmermans , + 2000,2001 Guus Sliepen + 2000,2001 Wessel Dankers - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. - This library is distributed in the hope that it will be useful, + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Original AVL tree library by Michael H. Buselli . @@ -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.1 2001/01/05 23:50:56 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;