]> git.sur5r.net Git - openldap/commitdiff
silence warnings
authorPierangelo Masarati <ando@openldap.org>
Wed, 19 Aug 2009 13:20:11 +0000 (13:20 +0000)
committerPierangelo Masarati <ando@openldap.org>
Wed, 19 Aug 2009 13:20:11 +0000 (13:20 +0000)
servers/slapd/back-ldap/search.c

index 7e1af12a9f966e40c5ad50bd354b2f825a5e0acd..c7458285016c94470e2e168ae306e56778d6f452 100644 (file)
@@ -832,7 +832,9 @@ ldap_build_entry(
                                        LBER_FREE( attr->a_nvals[i].bv_val );
                                LBER_FREE( attr->a_vals[i].bv_val );
                                attr->a_numvals--;
-                               if ( i < attr->a_numvals ) {
+
+                               assert( i >= 0 );
+                               if ( (unsigned)i < attr->a_numvals ) {
                                        attr->a_vals[i] = attr->a_vals[attr->a_numvals];
                                        if ( attr->a_nvals != attr->a_vals )
                                                attr->a_nvals[i] = attr->a_nvals[attr->a_numvals];