]> git.sur5r.net Git - openldap/commitdiff
Fix tavl_delete
authorHoward Chu <hyc@openldap.org>
Mon, 26 Sep 2005 08:15:37 +0000 (08:15 +0000)
committerHoward Chu <hyc@openldap.org>
Mon, 26 Sep 2005 08:15:37 +0000 (08:15 +0000)
libraries/liblutil/tavl.c

index 70b4eda6f372064510e9e004084651e04423b5a9..77069393aed91e494546a0bc2d57aac88329aeea 100644 (file)
@@ -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;
                }