/*
avl_tree.c -- avl_ tree and linked list convenience
Copyright (C) 1998 Michael H. Buselli
- 2000 Ivo Timmermans <itimmermans@bigfoot.com>,
- 2000 Guus Sliepen <guus@sliepen.warande.net>
- 2000 Wessel Dankers <wsl@nl.linux.org>
+ 2000,2001 Ivo Timmermans <itimmermans@bigfoot.com>,
+ 2000,2001 Guus Sliepen <guus@sliepen.warande.net>
+ 2000,2001 Wessel Dankers <wsl@nl.linux.org>
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
library for inclusion into tinc (http://tinc.nl.linux.org) by
Guus Sliepen <guus@sliepen.warande.net>.
- $Id: avl_tree.c,v 1.1.2.2 2001/01/06 18:21:17 guus Exp $
+ $Id: avl_tree.c,v 1.1.2.4 2001/01/08 21:32:00 guus Exp $
*/
#include <stdio.h>
node = avl_search_closest_node(tree, data, &result);
- if(result > 0)
+ if(result < 0)
node = node->prev;
return node;
node = avl_search_closest_node(tree, data, &result);
- if(result < 0)
+ if(result > 0)
node = node->next;
return node;