From: krw Date: Mon, 10 Apr 2023 19:44:43 +0000 (+0000) Subject: Make GPT display of menu hex octet the same as the MBR display. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=717a7d062d5b96d827d76b632d7cd9383f82baa5;p=openbsd Make GPT display of menu hex octet the same as the MBR display. i.e. two digits. --- diff --git a/sbin/fdisk/cmd.c b/sbin/fdisk/cmd.c index fdc7cdb24bc..fa027ab5009 100644 --- a/sbin/fdisk/cmd.c +++ b/sbin/fdisk/cmd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd.c,v 1.175 2023/04/09 17:19:59 krw Exp $ */ +/* $OpenBSD: cmd.c,v 1.176 2023/04/10 19:44:43 krw Exp $ */ /* * Copyright (c) 1997 Tobias Weingartner @@ -598,7 +598,7 @@ ask_uuid(const struct uuid *olduuid) dflt = PRT_uuid_to_menudflt(olduuid); if (dflt == NULL) { - if (asprintf(&dflt, "0") == -1) { + if (asprintf(&dflt, "00") == -1) { warn("asprintf()"); goto done; } diff --git a/sbin/fdisk/part.c b/sbin/fdisk/part.c index e67f9be399a..7160e870c9e 100644 --- a/sbin/fdisk/part.c +++ b/sbin/fdisk/part.c @@ -1,4 +1,4 @@ -/* $OpenBSD: part.c,v 1.154 2023/04/09 17:19:59 krw Exp $ */ +/* $OpenBSD: part.c,v 1.155 2023/04/10 19:44:43 krw Exp $ */ /* * Copyright (c) 1997 Tobias Weingartner @@ -1107,7 +1107,7 @@ PRT_uuid_to_menudflt(const struct uuid *uuid) continue; free(dflt); dflt = NULL; - if (asprintf(&dflt, "%X", menu_items[i].mi_menuid) == -1) + if (asprintf(&dflt, "%02X", menu_items[i].mi_menuid) == -1) return NULL; }