From 53833c6ae6734c1a0db27786f887ea1e9372791c Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Mon, 26 Sep 2005 08:15:37 +0000 Subject: [PATCH] Fix tavl_delete --- libraries/liblutil/tavl.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libraries/liblutil/tavl.c b/libraries/liblutil/tavl.c index 70b4eda6f3..77069393ae 100644 --- a/libraries/liblutil/tavl.c +++ b/libraries/liblutil/tavl.c @@ -251,10 +251,9 @@ tavl_delete( Avlnode **root, void* data, AVL_CMP fcmp ) *root = q; } /* new parent of p points to p */ - if ( depth > 2 ) { - r = pptr[depth-2]; + if ( depth > 1 ) { + r = pptr[depth-1]; r->avl_link[1] = p; - pptr[depth-1] = p; } else { q->avl_link[0] = p; }