]> git.sur5r.net Git - openldap/commitdiff
ITS#2217 fix option sorting
authorHoward Chu <hyc@openldap.org>
Thu, 22 May 2003 08:39:55 +0000 (08:39 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 22 May 2003 08:39:55 +0000 (08:39 +0000)
servers/slapd/ad.c

index b833773f36fdb1d7b66c3f81ac13dbb371118d2d..c65934f1541835460556a0eb25cebf432d35b8a3 100644 (file)
@@ -222,10 +222,10 @@ int slap_bv2ad(
                                } else if ( rc > 0 ||
                                        ( rc == 0 && (unsigned)optlen > tags[i].bv_len ))
                                {
-                                       AC_MEMCPY( &tags[i+1], &tags[i],
-                                               (ntags-i)*sizeof(struct berval) );
-                                       tags[i].bv_val = opt;
-                                       tags[i].bv_len = optlen;
+                                       AC_MEMCPY( &tags[i+2], &tags[i+1],
+                                               (ntags-i-1)*sizeof(struct berval) );
+                                       tags[i+1].bv_val = opt;
+                                       tags[i+1].bv_len = optlen;
                                        goto done;
                                }
                        }