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; }