From 8bec302fece083ba8874200277fecc2a824422c3 Mon Sep 17 00:00:00 2001 From: krw Date: Wed, 31 Aug 2022 08:35:07 +0000 Subject: [PATCH] If a partition both starts and ends beyond the end of the unit only warn about the start. ok millert@ --- sbin/disklabel/disklabel.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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++; } -- 2.20.1