diff options
author | Ray Lai <ray@cvs.openbsd.org> | 2007-02-20 01:44:17 +0000 |
---|---|---|
committer | Ray Lai <ray@cvs.openbsd.org> | 2007-02-20 01:44:17 +0000 |
commit | b8f1a1915038bd7cfda06cb95855197a81aac72d (patch) | |
tree | 399cddbfd71ecdbf040624f1b468bd244809428c /usr.bin | |
parent | db073d0cfe9686e479277d34e326d933571f9a40 (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 'usr.bin')
-rw-r--r-- | usr.bin/tip/value.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/tip/value.c b/usr.bin/tip/value.c index f381a1f1773..1c236f9cb25 100644 --- a/usr.bin/tip/value.c +++ b/usr.bin/tip/value.c @@ -1,4 +1,4 @@ -/* $OpenBSD: value.c,v 1.14 2006/03/17 22:02:58 moritz Exp $ */ +/* $OpenBSD: value.c,v 1.15 2007/02/20 01:44:16 ray Exp $ */ /* $NetBSD: value.c,v 1.6 1997/02/11 09:24:09 mrg Exp $ */ /* @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)value.c 8.1 (Berkeley) 6/6/93"; #endif -static const char rcsid[] = "$OpenBSD: value.c,v 1.14 2006/03/17 22:02:58 moritz Exp $"; +static const char rcsid[] = "$OpenBSD: value.c,v 1.15 2007/02/20 01:44:16 ray Exp $"; #endif /* not lint */ #include "tip.h" @@ -79,7 +79,7 @@ vinit(void) if ((fp = fopen(file, "r")) != NULL) { char *tp; - while (fgets(file, sizeof(file)-1, fp) != NULL) { + while (fgets(file, sizeof(file), fp) != NULL) { if (vflag) printf("set %s", file); if ((tp = strrchr(file, '\n'))) |