]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/attr.c
fix previous commit (ITS#5819)
[openldap] / servers / slapd / attr.c
index 8204fa7be860406b9f16cc9505a7dff3506b9eb1..4d578d9247de59f2db3e685a51f444716e2c36a7 100644 (file)
@@ -213,7 +213,7 @@ attr_dup2( Attribute *tmp, Attribute *a )
 {
        tmp->a_flags = a->a_flags & SLAP_ATTR_PERSISTENT_FLAGS;
        if ( a->a_vals != NULL ) {
-               int     i;
+               unsigned        i, j;
 
                tmp->a_numvals = a->a_numvals;
                tmp->a_vals = ch_malloc( (tmp->a_numvals + 1) * sizeof(struct berval) );
@@ -228,7 +228,6 @@ attr_dup2( Attribute *tmp, Attribute *a )
                assert( a->a_nvals != NULL );
 
                if ( a->a_nvals != a->a_vals ) {
-                       int     j;
 
                        tmp->a_nvals = ch_malloc( (tmp->a_numvals + 1) * sizeof(struct berval) );
                        for ( j = 0; !BER_BVISNULL( &a->a_nvals[j] ); j++ ) {
@@ -404,7 +403,7 @@ attr_valadd(
                                        rc = LDAP_TYPE_OR_VALUE_EXISTS;
                                return rc;
                        }
-                       for ( j = a->a_numvals; j >= slot; j-- ) {
+                       for ( j = a->a_numvals; j >= (int)slot; j-- ) {
                                a->a_vals[j+1] = a->a_vals[j];
                                if ( nvals )
                                        a->a_nvals[j+1] = a->a_nvals[j];