From: Howard Chu Date: Thu, 12 May 2005 03:24:49 +0000 (+0000) Subject: Fix attribute sorting X-Git-Tag: OPENLDAP_AC_BP~660 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=923bea9e1497192e8891143abf8fb6560115a801;p=openldap Fix attribute sorting --- diff --git a/servers/slapd/entry.c b/servers/slapd/entry.c index ffef157940..e83ed0000d 100644 --- a/servers/slapd/entry.c +++ b/servers/slapd/entry.c @@ -181,24 +181,23 @@ str2entry2( char *s, int checkvals ) int fv; for (i=0; ik; l-- ) { - type[l] = type[l-1]; - vals[l] = vals[l-1]; - freeval[l] = freeval[l-1]; + for ( k=j; k>i; k-- ) { + type[k] = type[k-1]; + vals[k] = vals[k-1]; + freeval[k] = freeval[k-1]; } - type[l] = type[i]; - vals[l] = bv; - freeval[l] = fv; + k++; + type[k] = type[i]; + vals[k] = bv; + freeval[k] = fv; } - i = k = j; + i++; } } }