Explorar el Código

fix blank ai_canonname from getaddrinfo for non-CNAMEs

Rich Felker hace 12 años
padre
commit
c0193550a0
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      src/network/getaddrinfo.c

+ 1 - 1
src/network/getaddrinfo.c

@@ -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++) {