]> git.sur5r.net Git - openldap/commitdiff
minor cleanup
authorPierangelo Masarati <ando@openldap.org>
Mon, 19 Jul 2004 21:43:03 +0000 (21:43 +0000)
committerPierangelo Masarati <ando@openldap.org>
Mon, 19 Jul 2004 21:43:03 +0000 (21:43 +0000)
servers/slapd/modify.c
servers/slapd/slapadd.c

index 08f484a00db0fc2622d5064e30ced1ea0b186946..133e216535da27e0a2c039e9cdcd2a3556a9e1df 100644 (file)
@@ -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;
index 8d6c54503d63a5ac17c4ac05bbec80e312b457a7..4e17e7e936d06ea6db72e9a7a8e7618e6142afb9 100644 (file)
@@ -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;