提交 c0193550 编写于 作者: R Rich Felker

fix blank ai_canonname from getaddrinfo for non-CNAMEs

上级 b0302863
......@@ -219,7 +219,7 @@ int getaddrinfo(const char *restrict host, const char *restrict serv, const stru
while (j--) buf[i++].sa.sin.sin_family = AF_INET6;
}
if (__dns_get_rr((void *)&buf[cnt], 0, 256, 1, reply, RR_CNAME, 1) < 0)
if (__dns_get_rr((void *)&buf[cnt], 0, 256, 1, reply, RR_CNAME, 1) <= 0)
strcpy((void *)&buf[cnt], host);
for (i=0; i<cnt; i++) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册