1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-30 16:51:41 +00:00

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>
This commit is contained in:
Hajimu UMEMOTO 2000-07-19 06:22:01 +00:00
parent 48f6bffc18
commit 05c36511b9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=63490

View File

@ -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;