aboutsummaryrefslogtreecommitdiff
path: root/resolv/getnetent.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1996-05-09 15:59:18 +0000
committerRoland McGrath <roland@gnu.org>1996-05-09 15:59:18 +0000
commit557072655748be14a747242135f1b34eff9f735f (patch)
tree9ee1bcb428de7c9f205cf093263d207d0b5ebb38 /resolv/getnetent.c
parent782e865067efc414b8dca36d8dd632d621ba94ef (diff)
downloadglibc-557072655748be14a747242135f1b34eff9f735f.zip
glibc-557072655748be14a747242135f1b34eff9f735f.tar.gz
glibc-557072655748be14a747242135f1b34eff9f735f.tar.bz2
* resolv: Code updated from BIND-4.9.3P2C3.
Diffstat (limited to 'resolv/getnetent.c')
-rw-r--r--resolv/getnetent.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/resolv/getnetent.c b/resolv/getnetent.c
index fb47c30..7ec5607 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);