From: Kurt Zeilenga Date: Tue, 16 May 2000 18:31:35 +0000 (+0000) Subject: Modify dn2domain code such that domains produced are rooted. X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~2944 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=88411f5c272e7de9bbb2e04bfd87901dea57c373;p=openldap Modify dn2domain code such that domains produced are rooted. That is, they end with '.'. --- diff --git a/libraries/libldap/dnssrv.c b/libraries/libldap/dnssrv.c index 2afee0a100..d9463a073f 100644 --- a/libraries/libldap/dnssrv.c +++ b/libraries/libldap/dnssrv.c @@ -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; }