From b8d16442565088a6feac23b6ff83fe0f8e97e143 Mon Sep 17 00:00:00 2001 From: Ray Lai Date: Tue, 20 Feb 2007 01:50:02 +0000 Subject: 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 long ago. OK millert@. --- sbin/disklabel/disklabel.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sbin') 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 @@ -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'; -- cgit v1.2.3