diff options
author | Ray Lai <ray@cvs.openbsd.org> | 2007-02-20 01:50:02 +0000 |
---|---|---|
committer | Ray Lai <ray@cvs.openbsd.org> | 2007-02-20 01:50:02 +0000 |
commit | b8d16442565088a6feac23b6ff83fe0f8e97e143 (patch) | |
tree | 6cfe79608934a231ca471727c27434cf14790e57 /sbin | |
parent | 065c1e822d00738cf2cbf9c4fa5eae074c9124ec (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/disklabel/disklabel.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sbin/disklabel/disklabel.c b/sbin/disklabel/disklabel.c index 538a848902e..2db486a8def 100644 --- a/sbin/disklabel/disklabel.c +++ b/sbin/disklabel/disklabel.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disklabel.c,v 1.103 2006/10/14 19:16:39 krw Exp $ */ +/* $OpenBSD: disklabel.c,v 1.104 2007/02/20 01:50:01 ray Exp $ */ /* * Copyright (c) 1987, 1993 @@ -39,7 +39,7 @@ static const char copyright[] = #endif /* not lint */ #ifndef lint -static const char rcsid[] = "$OpenBSD: disklabel.c,v 1.103 2006/10/14 19:16:39 krw Exp $"; +static const char rcsid[] = "$OpenBSD: disklabel.c,v 1.104 2007/02/20 01:50:01 ray Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -1274,7 +1274,7 @@ getasciilabel(FILE *f, struct disklabel *lp) lp->d_bbsize = BBSIZE; /* XXX */ lp->d_sbsize = SBSIZE; /* XXX */ - while (fgets(line, sizeof(line) - 1, f)) { + while (fgets(line, sizeof(line), f)) { lineno++; if ((cp = strpbrk(line, "#\r\n"))) *cp = '\0'; |