X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fnetwork%2Fresolvconf.c;h=ceabf0808450b056708129b5b937e413884c5c8c;hb=ae388becb529428ac926da102f1d025b3c3968da;hp=7e4dbe21a13e9519efe74f14736b50ae0baeb0cc;hpb=fe8453d2ee128cfcf8777a19659f1c1f19e052ac;p=musl diff --git a/src/network/resolvconf.c b/src/network/resolvconf.c index 7e4dbe21..ceabf080 100644 --- a/src/network/resolvconf.c +++ b/src/network/resolvconf.c @@ -3,6 +3,7 @@ #include #include #include +#include #include int __get_resolv_conf(struct resolvconf *conf, char *search, size_t search_sz) @@ -10,7 +11,7 @@ int __get_resolv_conf(struct resolvconf *conf, char *search, size_t search_sz) char line[256]; unsigned char _buf[256]; FILE *f, _f; - int nns; + int nns = 0; conf->ndots = 1; conf->timeout = 5; @@ -45,8 +46,8 @@ int __get_resolv_conf(struct resolvconf *conf, char *search, size_t search_sz) if (z != p) conf->ndots = x > 15 ? 15 : x; } p = strstr(line, "attempts:"); - if (p && isdigit(p[6])) { - p += 6; + if (p && isdigit(p[9])) { + p += 9; unsigned long x = strtoul(p, &z, 10); if (z != p) conf->attempts = x > 10 ? 10 : x; }