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/dump | |
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/dump')
-rw-r--r-- | sbin/dump/optr.c | 6 |
1 files changed, 3 insertions, 3 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"); |