From: krw Date: Wed, 31 Aug 2022 08:35:07 +0000 (+0000) Subject: If a partition both starts and ends beyond the end of the unit X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=8bec302fece083ba8874200277fecc2a824422c3;p=openbsd If a partition both starts and ends beyond the end of the unit only warn about the start. ok millert@ --- diff --git a/sbin/disklabel/disklabel.c b/sbin/disklabel/disklabel.c index 2a9cf7084d8..a95a10ef295 100644 --- a/sbin/disklabel/disklabel.c +++ b/sbin/disklabel/disklabel.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disklabel.c,v 1.241 2022/07/31 14:29:19 krw Exp $ */ +/* $OpenBSD: disklabel.c,v 1.242 2022/08/31 08:35:07 krw Exp $ */ /* * Copyright (c) 1987, 1993 @@ -1126,9 +1126,9 @@ checklabel(struct disklabel *lp) if (DL_GETPOFFSET(pp) > DL_GETDSIZE(lp)) { warnx("partition %c: offset past end of unit", part); errors++; - } - if (DL_GETPOFFSET(pp) + DL_GETPSIZE(pp) > DL_GETDSIZE(lp)) { - warnx("partition %c: partition extends past end of unit", + } else if (DL_GETPOFFSET(pp) + DL_GETPSIZE(pp) > + DL_GETDSIZE(lp)) { + warnx("partition %c: extends past end of unit", part); errors++; }