From 42a9661071f8b689075758ff395c66656b06a7d4 Mon Sep 17 00:00:00 2001 From: Hallvard Furuseth Date: Sat, 30 Jul 2005 23:46:07 +0000 Subject: [PATCH] Initialize i (#changes) if no mods. Simplify (*modp) to lmod. --- servers/slapd/slapi/slapi_utils.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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++; } }