X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fnetwork%2F__dns.c;h=b53ad4ab0f47e05837bcf479a2221a3228d4f029;hb=28bde3b78746c4f773600c415fbc740efec4e311;hp=cdd642991b5d1c9cdb818c28d3c21e3658e49246;hpb=d4fbebe18d2d063069b1505d357a1ff3b5ca0ab8;p=musl diff --git a/src/network/__dns.c b/src/network/__dns.c index cdd64299..b53ad4ab 100644 --- a/src/network/__dns.c +++ b/src/network/__dns.c @@ -257,10 +257,12 @@ int __dns_count_addrs(const unsigned char *r, int cnt) int found=0, res, i; static const int p[2][2] = { { 4, RR_A }, { 16, RR_AAAA } }; - while (cnt--) for (i=0; i<2; i++) { - res = __dns_get_rr(0, 0, p[i][0], -1, r, p[i][1], 0); - if (res < 0) return res; - found += res; + while (cnt--) { + for (i=0; i<2; i++) { + res = __dns_get_rr(0, 0, p[i][0], -1, r, p[i][1], 0); + if (res < 0) return res; + found += res; + } r += 512; } return found;