summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2022-08-31 08:35:08 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2022-08-31 08:35:08 +0000
commit05eefb2f865728d63bca52a9728d7bb5a2268762 (patch)
tree158664f841c3b027b2c03580277dfc58b196d1af /sbin
parentfb6383b1e3110f841ff80c1c7eb3518b5195d9e6 (diff)
If a partition both starts and ends beyond the end of the unit
only warn about the start. ok millert@
Diffstat (limited to 'sbin')
-rw-r--r--sbin/disklabel/disklabel.c8
1 files 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++;
}