From: krw Date: Sat, 4 Mar 2023 23:09:15 +0000 (+0000) Subject: Don't whine about invalid start/end values when X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c4840cb2c913e3c9f51f7c17aafce10304a53d6e;p=openbsd Don't whine about invalid start/end values when starting to edit an unused GPT partition. --- diff --git a/sbin/fdisk/gpt.c b/sbin/fdisk/gpt.c index ff8bdfa96f0..7f82960ead5 100644 --- a/sbin/fdisk/gpt.c +++ b/sbin/fdisk/gpt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gpt.c,v 1.84 2023/03/04 14:47:18 krw Exp $ */ +/* $OpenBSD: gpt.c,v 1.85 2023/03/04 23:09:15 krw Exp $ */ /* * Copyright (c) 2015 Markus Muller * Copyright (c) 2015 Kenneth R Westerback @@ -481,11 +481,13 @@ GPT_print_part(const unsigned int pn, const char *units, const int verbosity) } } - if (start > end) - printf("partition %u first LBA is > last LBA\n", pn); - if (start < gh.gh_lba_start || end > gh.gh_lba_end) - printf("partition %u extends beyond usable LBA range of %s\n", - pn, disk.dk_name); + if (uuid_is_nil(&gp[pn].gp_type, NULL) == 0) { + if (start > end) + printf("partition %u first LBA is > last LBA\n", pn); + if (start < gh.gh_lba_start || end > gh.gh_lba_end) + printf("partition %u extends beyond usable LBA range " + "of %s\n", pn, disk.dk_name); + } } int