From: Howard Chu Date: Thu, 22 May 2003 08:39:55 +0000 (+0000) Subject: ITS#2217 fix option sorting X-Git-Tag: OPENLDAP_REL_ENG_2_2_0ALPHA~83 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ade6b8b75080cad11d7a2fd9fbc6b193090e26e5;p=openldap ITS#2217 fix option sorting --- diff --git a/servers/slapd/ad.c b/servers/slapd/ad.c index b833773f36..c65934f154 100644 --- a/servers/slapd/ad.c +++ b/servers/slapd/ad.c @@ -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; } }