aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libc/net/name6.c
diff options
context:
space:
mode:
authorHajimu UMEMOTO <ume@FreeBSD.org>2000-07-19 06:22:01 +0000
committerHajimu UMEMOTO <ume@FreeBSD.org>2000-07-19 06:22:01 +0000
commit31cc3a5c562006ac914d37f5c9572ec7a530e95b (patch)
tree46af6a7c2ce0bcd9dcf44adf8294180f757c1944 /lib/libc/net/name6.c
parent3e413989d1f56b7aa9cefc6ed837b74448b8460b (diff)
downloadsrc-31cc3a5c562006ac914d37f5c9572ec7a530e95b.tar.gz
src-31cc3a5c562006ac914d37f5c9572ec7a530e95b.zip
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>
Notes
Notes: svn path=/stable/4/; revision=63490
Diffstat (limited to 'lib/libc/net/name6.c')
-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 db407dd163cc..8edcb1bee858 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;