]> git.sur5r.net Git - openldap/commitdiff
Initialize i (#changes) if no mods. Simplify (*modp) to lmod.
authorHallvard Furuseth <hallvard@openldap.org>
Sat, 30 Jul 2005 23:46:07 +0000 (23:46 +0000)
committerHallvard Furuseth <hallvard@openldap.org>
Sat, 30 Jul 2005 23:46:07 +0000 (23:46 +0000)
servers/slapd/slapi/slapi_utils.c

index ff8a6c00bdd65c87ddf77fc0fdb3992e38c91d86..fea5e7d02eb09bf1a93c6a2538927eddd43b119a 100644 (file)
@@ -2770,15 +2770,16 @@ Modifications *slapi_int_ldapmods2modifications ( LDAPMod **mods, void *memctx )
                mod->sml_desc = ad;
                mod->sml_next = NULL;
 
+               i = 0;
                if ( lmod->mod_op & LDAP_MOD_BVALUES ) {
                        if ( lmod->mod_bvalues != NULL ) {
-                               for ( i = 0; lmod->mod_bvalues[i] != NULL; i++ )
-                                       ;
+                               while ( lmod->mod_bvalues[i] != NULL )
+                                       i++;
                        }
                } else {
-                       if ( (*modp)->mod_values != NULL ) {
-                               for ( i = 0; lmod->mod_values[i] != NULL; i++ )
-                                       ;
+                       if ( lmod->mod_values != NULL ) {
+                               while ( lmod->mod_values[i] != NULL )
+                                       i++;
                        }
                }