]> git.sur5r.net Git - openldap/commitdiff
Import ITS#3046 fix from HEAD
authorHoward Chu <hyc@openldap.org>
Wed, 7 Apr 2004 14:28:50 +0000 (14:28 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 7 Apr 2004 14:28:50 +0000 (14:28 +0000)
servers/slapd/back-ldbm/idl.c

index 16c3e6da519b6b7decbdaee40696cf4a07d909cc..4c4a2f150c58265c4dec43ad3a692da157aa92a9 100644 (file)
@@ -943,13 +943,16 @@ idl_delete_key (
           */
        cont_alloc( &data, &key );
 #ifndef USE_INDIRECT_NIDS
-       for ( nids = 0; !ID_BLOCK_NOID(idl, nids); nids++ )
-               ;       /* NULL */
+       for ( nids = 0; !ID_BLOCK_NOID(idl, nids); nids++ ) {
+               ;       /* Empty */
+       }
 
        for ( j = 0; j<nids; j++ ) 
 #else
        nids = ID_BLOCK_NIDS(idl);
-       for ( j = idl_find(idl, id); j >= 0; j = -1)    /* execute once */
+       j = idl_find(idl, id);
+       if ( ID_BLOCK_ID(idl, j) > id ) j--;
+       for (; j >= 0; j = -1)  /* execute once */
 #endif
        {
                ID_BLOCK *tmp;