提交 690233bc 编写于 作者: B Bodo Möller

Submitted by: Lidong Zhou <ldzhou@cs.cornell.edu>

上级 fd520577
......@@ -282,12 +282,12 @@ static struct hostent *ghbn_dup(struct hostent *a)
j=strlen(a->h_name)+1;
if ((ret->h_name=Malloc(j)) == NULL) goto err;
memcpy((char *)ret->h_name,a->h_name,j+1);
memcpy((char *)ret->h_name,a->h_name,j);
for (i=0; a->h_aliases[i] != NULL; i++)
{
j=strlen(a->h_aliases[i])+1;
if ((ret->h_aliases[i]=Malloc(j)) == NULL) goto err;
memcpy(ret->h_aliases[i],a->h_aliases[i],j+1);
memcpy(ret->h_aliases[i],a->h_aliases[i],j);
}
ret->h_length=a->h_length;
ret->h_addrtype=a->h_addrtype;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册