From 46a2616b83b52e591a6e1d9869faba1652f86d5b Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Wed, 26 Feb 2003 03:12:02 +0000 Subject: [PATCH] Fix -USLAP_NVALUES --- servers/slapd/add.c | 10 ++++++---- servers/slapd/modify.c | 12 ++++++------ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/servers/slapd/add.c b/servers/slapd/add.c index baca001b84..49f7b3440c 100644 --- a/servers/slapd/add.c +++ b/servers/slapd/add.c @@ -413,7 +413,7 @@ slap_mods2entry( for( i=0; attr->a_vals[i].bv_val; i++ ) { /* count them */ } - for( j=0; mods->sml_nvalues[j].bv_val; j++ ) { + for( j=0; mods->sml_values[j].bv_val; j++ ) { /* count them */ } j++; /* NULL */ @@ -423,13 +423,14 @@ slap_mods2entry( /* should check for duplicates */ - AC_MEMCPY( &attr->a_vals[i], mods->sml_nvalues, + AC_MEMCPY( &attr->a_vals[i], mods->sml_values, sizeof( struct berval ) * j ); /* trim the mods array */ - ch_free( mods->sml_nvalues ); - mods->sml_nvalues = NULL; + ch_free( mods->sml_values ); + mods->sml_values = NULL; +#ifdef SLAP_NVALUES if( attr->a_nvals ) { attr->a_nvals = ch_realloc( attr->a_nvals, sizeof( struct berval ) * (i+j) ); @@ -441,6 +442,7 @@ slap_mods2entry( ch_free( mods->sml_nvalues ); mods->sml_nvalues = NULL; } +#endif continue; #else diff --git a/servers/slapd/modify.c b/servers/slapd/modify.c index aafd723610..fcde972853 100644 --- a/servers/slapd/modify.c +++ b/servers/slapd/modify.c @@ -562,7 +562,7 @@ int slap_mods_check( /* * check values */ - if( ml->sml_nvalues != NULL ) { + if( ml->sml_values != NULL ) { ber_len_t nvals; slap_syntax_validate_func *validate = ad->ad_type->sat_syntax->ssyn_validate; @@ -583,14 +583,14 @@ int slap_mods_check( * check that each value is valid per syntax * and pretty if appropriate */ - for( nvals = 0; ml->sml_nvalues[nvals].bv_val; nvals++ ) { + for( nvals = 0; ml->sml_values[nvals].bv_val; nvals++ ) { struct berval pval; if( pretty ) { rc = pretty( ad->ad_type->sat_syntax, - &ml->sml_nvalues[nvals], &pval ); + &ml->sml_values[nvals], &pval ); } else { rc = validate( ad->ad_type->sat_syntax, - &ml->sml_nvalues[nvals] ); + &ml->sml_values[nvals] ); } if( rc != 0 ) { @@ -602,8 +602,8 @@ int slap_mods_check( } if( pretty ) { - ber_memfree( ml->sml_nvalues[nvals].bv_val ); - ml->sml_nvalues[nvals] = pval; + ber_memfree( ml->sml_values[nvals].bv_val ); + ml->sml_values[nvals] = pval; } } -- 2.39.5