diff options
author | ume <ume@FreeBSD.org> | 2005-04-28 15:32:55 +0000 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2005-04-28 15:32:55 +0000 |
commit | c2ee427f58870a57f71f4e20d3f83c4e6bdde733 (patch) | |
tree | 7465bfa6b308dec24c1b65088f6169e249880ea4 /lib/libc/net/getprotoent.c | |
parent | 73700934ebe1998a883da9c450c2d1ed47079cad (diff) | |
download | FreeBSD-src-c2ee427f58870a57f71f4e20d3f83c4e6bdde733.zip FreeBSD-src-c2ee427f58870a57f71f4e20d3f83c4e6bdde733.tar.gz |
make getnetby*() thread-safe.
Diffstat (limited to 'lib/libc/net/getprotoent.c')
-rw-r--r-- | lib/libc/net/getprotoent.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/net/getprotoent.c b/lib/libc/net/getprotoent.c index 037547b..705ba42 100644 --- a/lib/libc/net/getprotoent.c +++ b/lib/libc/net/getprotoent.c @@ -130,7 +130,7 @@ getprotoent_r(struct protoent *pe, struct protoent_data *ped) if (ped->fp == NULL && (ped->fp = fopen(_PATH_PROTOCOLS, "r")) == NULL) return (-1); again: - if ((p = fgets(ped->line, BUFSIZ, ped->fp)) == NULL) + if ((p = fgets(ped->line, sizeof ped->line, ped->fp)) == NULL) return (-1); if (*p == '#') goto again; @@ -159,7 +159,7 @@ again: cp++; continue; } - if (q < &ped->aliases[PROTOENT_MAXALIASES - 1]) + if (q < &ped->aliases[_MAXALIASES - 1]) *q++ = cp; cp = strpbrk(cp, " \t"); if (cp != NULL) |