From d3292b83fad467b13f38664aeefcf70555a456f4 Mon Sep 17 00:00:00 2001 From: Luke Howard Date: Sun, 19 Jan 2003 22:49:21 +0000 Subject: [PATCH] Style consistency in new SLAPI_MODIFY_MODS code --- servers/slapd/modify.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/servers/slapd/modify.c b/servers/slapd/modify.c index 51aaa39161..92b45d4be8 100644 --- a/servers/slapd/modify.c +++ b/servers/slapd/modify.c @@ -344,8 +344,8 @@ do_modify( slapi_operation_set_pb( pb, op ); slapi_pblock_set( pb, SLAPI_MODIFY_TARGET, (void *)dn.bv_val ); slapi_pblock_set( pb, SLAPI_MANAGEDSAIT, (void *)(1) ); - modv = Modifications2LDAPMods(modlist); - slapi_pblock_set( pb, SLAPI_MODIFY_MODS, (void *)modv); + modv = Modifications2LDAPMods( modlist ); + slapi_pblock_set( pb, SLAPI_MODIFY_MODS, (void *)modv ); rc = doPluginFNs( be, SLAPI_PLUGIN_PRE_MODIFY_FN, pb ); if ( rc != 0 && rc != LDAP_OTHER ) { @@ -775,33 +775,33 @@ static LDAPMod **Modifications2LDAPMods(Modifications *modlist) Modifications *ml; /* based on back-ldap/modify.c */ - for (i = 0, ml = modlist; ml != NULL; i++, ml = ml->sml_next) + for( i = 0, ml = modlist; ml != NULL; i++, ml = ml->sml_next ) ; - mods = (LDAPMod *)ch_malloc(i * sizeof(LDAPMod)); + mods = (LDAPMod *)ch_malloc( i * sizeof(LDAPMod) ); if (mods == NULL) { return NULL; } - modv = (LDAPMod **)ch_malloc((i + 1) * sizeof(LDAPMod *)); + modv = (LDAPMod **)ch_malloc( (i + 1) * sizeof(LDAPMod *) ); if (modv == NULL) { ch_free(mods); return NULL; } - for (i = 0, ml = modlist; ml != NULL; ml = ml->sml_next) { - if (ml->sml_desc->ad_type->sat_no_user_mod) { + for( i = 0, ml = modlist; ml != NULL; ml = ml->sml_next ) { + if ( ml->sml_desc->ad_type->sat_no_user_mod ) { continue; } modv[i] = &mods[i]; mods[i].mod_op = ml->sml_op | LDAP_MOD_BVALUES; mods[i].mod_type = ml->sml_desc->ad_cname.bv_val; if (ml->sml_bvalues != NULL) { - for (j = 0; ml->sml_bvalues[j].bv_val != NULL; j++) + for( j = 0; ml->sml_bvalues[j].bv_val != NULL; j++ ) ; - mods[i].mod_bvalues = (struct berval **)ch_malloc((j + 1) * - sizeof(struct berval *)); - for (j = 0; ml->sml_bvalues[j].bv_val != NULL; j++) + mods[i].mod_bvalues = (struct berval **)ch_malloc( (j + 1) * + sizeof(struct berval *) ); + for( j = 0; ml->sml_bvalues[j].bv_val != NULL; j++ ) mods[i].mod_bvalues[j] = &ml->sml_bvalues[j]; } else { mods[i].mod_bvalues = NULL; @@ -823,11 +823,11 @@ static void FreeLDAPMods(LDAPMod **modv) mods = modv[0]; - for (i = 0; modv[i] != NULL; i++) { - ch_free(modv[i]->mod_bvalues); + for( i = 0; modv[i] != NULL; i++ ) { + ch_free( modv[i]->mod_bvalues ); } - ch_free(mods); - ch_free(modv); + ch_free( mods ); + ch_free( modv ); } #endif /* LDAP_SLAPI */ -- 2.39.5