diff options
Diffstat (limited to 'resolv/getnetent.c')
-rw-r--r-- | resolv/getnetent.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/resolv/getnetent.c b/resolv/getnetent.c index fb47c30c99..7ec5607781 100644 --- a/resolv/getnetent.c +++ b/resolv/getnetent.c @@ -143,18 +143,19 @@ again: net.n_net = inet_network(cp); net.n_addrtype = AF_INET; q = net.n_aliases = net_aliases; - if (p != NULL) + if (p != NULL) { cp = p; - while (cp && *cp) { - if (*cp == ' ' || *cp == '\t') { - cp++; - continue; + while (cp && *cp) { + if (*cp == ' ' || *cp == '\t') { + cp++; + continue; + } + if (q < &net_aliases[MAXALIASES - 1]) + *q++ = cp; + cp = strpbrk(cp, " \t"); + if (cp != NULL) + *cp++ = '\0'; } - if (q < &net_aliases[MAXALIASES - 1]) - *q++ = cp; - cp = strpbrk(cp, " \t"); - if (cp != NULL) - *cp++ = '\0'; } *q = NULL; return (&net); |