From 4c16e670949c300a9d7f30ef4d66ae310998316d Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Mon, 19 Jul 2004 21:43:03 +0000 Subject: [PATCH] minor cleanup --- servers/slapd/modify.c | 3 +-- servers/slapd/slapadd.c | 8 +++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/servers/slapd/modify.c b/servers/slapd/modify.c index 08f484a00d..133e216535 100644 --- a/servers/slapd/modify.c +++ b/servers/slapd/modify.c @@ -874,8 +874,7 @@ int slap_mods_opattrs( timestamp.bv_len = strlen(timebuf); if( op->o_dn.bv_len == 0 ) { - name.bv_val = SLAPD_ANONYMOUS; - name.bv_len = sizeof(SLAPD_ANONYMOUS)-1; + BER_BVSTR( &name, SLAPD_ANONYMOUS ); nname = name; } else { name = op->o_dn; diff --git a/servers/slapd/slapadd.c b/servers/slapd/slapadd.c index 8d6c54503d..4e17e7e936 100644 --- a/servers/slapd/slapadd.c +++ b/servers/slapd/slapadd.c @@ -237,11 +237,9 @@ slapadd( int argc, char **argv ) timestamp.bv_val = timebuf; timestamp.bv_len = strlen(timebuf); - if ( be->be_rootndn.bv_len == 0 ) { - name.bv_val = SLAPD_ANONYMOUS; - name.bv_len = sizeof(SLAPD_ANONYMOUS) - 1; - nname.bv_val = SLAPD_ANONYMOUS; - nname.bv_len = sizeof(SLAPD_ANONYMOUS) - 1; + if ( BER_BVISEMPTY( &be->be_rootndn ) ) { + BER_BVSTR( &name, SLAPD_ANONYMOUS ); + nname = name; } else { name = be->be_rootdn; nname = be->be_rootndn; -- 2.39.5