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 /sbin | |
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 'sbin')
-rw-r--r-- | sbin/dump/optr.c | 6 | ||||
-rw-r--r-- | sbin/routed/parms.c | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/sbin/dump/optr.c b/sbin/dump/optr.c index 2a153084f8c..6d3dd331445 100644 --- a/sbin/dump/optr.c +++ b/sbin/dump/optr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: optr.c,v 1.28 2004/11/04 20:10:07 deraadt Exp $ */ +/* $OpenBSD: optr.c,v 1.29 2007/02/20 01:44:16 ray Exp $ */ /* $NetBSD: optr.c,v 1.11 1997/05/27 08:34:36 mrg Exp $ */ /*- @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)optr.c 8.2 (Berkeley) 1/6/94"; #else -static const char rcsid[] = "$OpenBSD: optr.c,v 1.28 2004/11/04 20:10:07 deraadt Exp $"; +static const char rcsid[] = "$OpenBSD: optr.c,v 1.29 2007/02/20 01:44:16 ray Exp $"; #endif #endif /* not lint */ @@ -92,7 +92,7 @@ query(char *question) back = -1; errcount = 0; do { - if (fgets(replybuffer, 63, mytty) == NULL) { + if (fgets(replybuffer, sizeof(replybuffer), mytty) == NULL) { clearerr(mytty); if (++errcount > 30) /* XXX ugly */ quit("excessive operator query failures\n"); diff --git a/sbin/routed/parms.c b/sbin/routed/parms.c index f5f70de2b27..f446f7536f2 100644 --- a/sbin/routed/parms.c +++ b/sbin/routed/parms.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parms.c,v 1.14 2006/10/24 19:44:29 moritz Exp $ */ +/* $OpenBSD: parms.c,v 1.15 2007/02/20 01:44:16 ray Exp $ */ /* * Copyright (c) 1983, 1993 @@ -145,7 +145,7 @@ gwkludge(void) return; for (;;) { - if (fgets(lbuf, sizeof(lbuf)-1, fp) == NULL) + if (fgets(lbuf, sizeof(lbuf), fp) == NULL) break; lptr = lbuf; while (*lptr == ' ') |