]> git.sur5r.net Git - openldap/commitdiff
cleanup
authorPierangelo Masarati <ando@openldap.org>
Fri, 6 Aug 2004 16:40:15 +0000 (16:40 +0000)
committerPierangelo Masarati <ando@openldap.org>
Fri, 6 Aug 2004 16:40:15 +0000 (16:40 +0000)
servers/slapd/acl.c
servers/slapd/add.c

index d0a2976190c392f0e16a8badaa8e47035f93b6e3..475826cc87a77bf75f6947f03ab5f22aa9c9d0bd 100644 (file)
@@ -1407,7 +1407,7 @@ dn_match_cleanup:;
                                * rights are determined by OR'ing the individual
                                * rights given by the acis.
                                */
-                               for ( i = 0; at->a_vals[i].bv_val != NULL; i++ ) {
+                               for ( i = 0; !BER_BVISNULL( &at->a_nvals[i] ); i++ ) {
                                        if (aci_mask( op,
                                                e, desc, val,
                                                &at->a_nvals[i],
@@ -1856,7 +1856,8 @@ aci_match_set (
 
                                        set = bvals[0];
                                        BER_BVZERO( &bvals[0] );
-                                       for ( i = 1; !BER_BVISNULL( &bvals[i] ); i++ );
+                                       for ( i = 1; !BER_BVISNULL( &bvals[i] ); i++ )
+                                               /* count */ ;
                                        bvals[0].bv_val = bvals[i-1].bv_val;
                                        BER_BVZERO( &bvals[i-1] );
                                }
index 0ed59d33167b7192566a1780cb676179ae018761..1e856c8921bac067ed14f16265cff81ac0e83420 100644 (file)
@@ -570,8 +570,7 @@ slap_mods2entry(
                        for ( i = 0; mods->sml_values[i].bv_val; i++ ) {
                                ber_dupbv( &attr->a_vals[i], &mods->sml_values[i] );
                        }
-                       attr->a_vals[i].bv_len = 0;
-                       attr->a_vals[i].bv_val = NULL;
+                       BER_BVZERO( &attr->a_vals[i] );
                } else {
                        attr->a_vals = mods->sml_values;
                        mods->sml_values = NULL;
@@ -585,8 +584,7 @@ slap_mods2entry(
                                for ( i = 0; mods->sml_nvalues[i].bv_val; i++ ) {
                                        ber_dupbv( &attr->a_nvals[i], &mods->sml_nvalues[i] );
                                }
-                               attr->a_nvals[i].bv_len = 0;
-                               attr->a_nvals[i].bv_val = NULL;
+                               BER_BVZERO( &attr->a_nvals[i] );
                        } else {
                                attr->a_nvals = mods->sml_nvalues;
                                mods->sml_nvalues = NULL;