-/* $OpenBSD: cmd.c,v 1.152 2022/02/04 18:21:33 krw Exp $ */
+/* $OpenBSD: cmd.c,v 1.153 2022/03/15 17:59:39 krw Exp $ */
/*
* Copyright (c) 1997 Tobias Weingartner
printf("Partition %d flag value set to 0x%llx.\n", pn, val);
} else {
if (letoh64(gh.gh_sig) == GPTSIGNATURE) {
- for (i = 0; i < NGPTPARTITIONS; i++) {
+ for (i = 0; i < letoh32(gh.gh_part_num); i++) {
if (i == pn)
gp[i].gp_attrs = htole64(GPTDOSACTIVE);
else
-/* $OpenBSD: gpt.c,v 1.59 2022/03/11 22:29:55 krw Exp $ */
+/* $OpenBSD: gpt.c,v 1.60 2022/03/15 17:59:39 krw Exp $ */
/*
* Copyright (c) 2015 Markus Muller <mmu@grummel.net>
* Copyright (c) 2015 Kenneth R Westerback <krw@openbsd.org>
if (how == GHANDGP)
memset(&gp, 0, sizeof(gp));
else {
- for (pn = 0; pn < NGPTPARTITIONS; pn++) {
+ for (pn = 0; pn < letoh32(gh.gh_part_num); pn++) {
if (PRT_protected_guid(&gp[pn].gp_type))
continue;
memset(&gp[pn], 0, sizeof(gp[pn]));
-/* $OpenBSD: part.c,v 1.120 2022/03/14 17:11:44 krw Exp $ */
+/* $OpenBSD: part.c,v 1.121 2022/03/15 17:59:39 krw Exp $ */
/*
* Copyright (c) 1997 Tobias Weingartner
if (strncmp(str, efistr, UUID_STR_LEN) == 0) {
/* Look for partitions indicating a need to preserve EFI Sys */
- for (i = 0; i < NGPTPARTITIONS; i++) {
+ for (i = 0; i < letoh32(gh.gh_part_num); i++) {
typename = PRT_uuid_to_typename(&gp[i].gp_type);
if (strncmp(typename, "APFS ", 5))
continue;