summaryrefslogtreecommitdiffstats
path: root/lib/libc/net
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2000-07-19 06:22:01 +0000
committerume <ume@FreeBSD.org>2000-07-19 06:22:01 +0000
commit174b0abb778419b135794001f2dc68abaf345e67 (patch)
treef9c68803c8eb86506c5059084b0ae673ae42ae6c /lib/libc/net
parentf41547bc4459fe28ba079dadfaa3388f66a940f3 (diff)
downloadFreeBSD-src-174b0abb778419b135794001f2dc68abaf345e67.zip
FreeBSD-src-174b0abb778419b135794001f2dc68abaf345e67.tar.gz
To define A RR to root (.) is valid in DNS. So, h_name = "" shouldn't
be treated as NULL. PR: bin/19816 Submitted by: Bill Fenner <fenner@research.att.com> Reviewed by: Atsushi Onoe <onoe@sm.sony.co.jp>
Diffstat (limited to 'lib/libc/net')
-rw-r--r--lib/libc/net/name6.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/net/name6.c b/lib/libc/net/name6.c
index db407dd..8edcb1b 100644
--- a/lib/libc/net/name6.c
+++ b/lib/libc/net/name6.c
@@ -552,7 +552,7 @@ _hpcopy(struct hostent *hp, int *errp)
/* count size to be allocated */
size = sizeof(struct hostent);
- if (hp->h_name != NULL && *hp->h_name != '\0')
+ if (hp->h_name != NULL)
size += strlen(hp->h_name) + 1;
if ((pp = hp->h_aliases) != NULL) {
for (i = 0; *pp != NULL; i++, pp++) {
@@ -580,7 +580,7 @@ _hpcopy(struct hostent *hp, int *errp)
return NULL;
}
cp = (char *)&nhp[1];
- if (hp->h_name != NULL && *hp->h_name != '\0') {
+ if (hp->h_name != NULL) {
nhp->h_name = cp;
strcpy(cp, hp->h_name);
cp += strlen(cp) + 1;
OpenPOWER on IntegriCloud