]> git.sur5r.net Git - openldap/commitdiff
Modify dn2domain code such that domains produced are rooted.
authorKurt Zeilenga <kurt@openldap.org>
Tue, 16 May 2000 18:31:35 +0000 (18:31 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Tue, 16 May 2000 18:31:35 +0000 (18:31 +0000)
That is, they end with '.'.

libraries/libldap/dnssrv.c

index 2afee0a100d738ef733cfdceecde0a30dad7d8b0..d9463a073fe9a04bfa4e97adcd7414479c47fb5a 100644 (file)
@@ -96,7 +96,7 @@ int ldap_dn2domain(
 
                                ndomain = LDAP_REALLOC( domain,
                                        ( domain == NULL ? 0 : strlen(domain) )
-                                       + strlen(dc) + 2 );
+                                       + strlen(dc) + "." );
 
                                if( ndomain == NULL ) {
                                        LDAP_FREE( rdn );
@@ -106,12 +106,9 @@ int ldap_dn2domain(
                                        return -5;
                                }
 
-                               if( domain == NULL ) {
-                                       ndomain[0] = '\0';
-                               } else {
-                                       strcat( ndomain, "." );
-                               }
                                strcat( ndomain, dc );
+                               strcat( ndomain, "." );
+
                                domain = ndomain;
                                continue;
                        }