From: Hallvard Furuseth Date: Sat, 30 Jul 2005 23:46:07 +0000 (+0000) Subject: Initialize i (#changes) if no mods. Simplify (*modp) to lmod. X-Git-Tag: OPENLDAP_AC_BP~140 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=42a9661071f8b689075758ff395c66656b06a7d4;p=openldap Initialize i (#changes) if no mods. Simplify (*modp) to lmod. --- diff --git a/servers/slapd/slapi/slapi_utils.c b/servers/slapd/slapi/slapi_utils.c index ff8a6c00bd..fea5e7d02e 100644 --- a/servers/slapd/slapi/slapi_utils.c +++ b/servers/slapd/slapi/slapi_utils.c @@ -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++; } }