diff options
author | Ray Lai <ray@cvs.openbsd.org> | 2007-02-20 01:47:04 +0000 |
---|---|---|
committer | Ray Lai <ray@cvs.openbsd.org> | 2007-02-20 01:47:04 +0000 |
commit | 065c1e822d00738cf2cbf9c4fa5eae074c9124ec (patch) | |
tree | bd865808c7fd1056886e73cacd5ffb254bc262cb /lib/libc | |
parent | b8f1a1915038bd7cfda06cb95855197a81aac72d (diff) |
Change hard coded numbers to sizeof(buf). Also change some
sizeof(buf) - 1 to sizeof(buf), since fgets takes the whole buffer size.
Based on diff from Charles Longeau <chl at tuxfamily dot org> long ago.
OK millert@.
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/rpc/getrpcent.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/rpc/getrpcent.c b/lib/libc/rpc/getrpcent.c index 444d113a6c6..b37381aa31c 100644 --- a/lib/libc/rpc/getrpcent.c +++ b/lib/libc/rpc/getrpcent.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getrpcent.c,v 1.13 2005/08/08 08:05:35 espie Exp $ */ +/* $OpenBSD: getrpcent.c,v 1.14 2007/02/20 01:47:03 ray Exp $ */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for * unrestricted use provided that this legend is included on all tape @@ -141,7 +141,7 @@ getrpcent(void) if (d->rpcf == NULL && (d->rpcf = fopen(RPCDB, "r")) == NULL) return (NULL); /* -1 so there is room to append a \n below */ - if (fgets(d->line, BUFSIZ-1, d->rpcf) == NULL) + if (fgets(d->line, sizeof(d->line) - 1, d->rpcf) == NULL) return (NULL); return (interpret(d->line, strlen(d->line))); } |