[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 6/7] commands/probe: use grub_gpt_part_guid_snprint
From: |
Oliver Steffen |
Subject: |
[PATCH v2 6/7] commands/probe: use grub_gpt_part_guid_snprint |
Date: |
Mon, 20 Feb 2023 19:56:29 +0100 |
Use the new function for printing the partition guid.
Signed-off-by: Oliver Steffen <osteffen@redhat.com>
---
grub-core/commands/probe.c | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/grub-core/commands/probe.c b/grub-core/commands/probe.c
index 9a80ea54f..3fe50d11e 100644
--- a/grub-core/commands/probe.c
+++ b/grub-core/commands/probe.c
@@ -104,7 +104,7 @@ grub_cmd_probe (grub_extcmd_context_t ctxt, int argc, char
**args)
if (state[6].set)
{
/* AAAABBBB-CCCC-DDDD-EEEE-FFFFFFFFFFFF + null terminator */
- char val[37] = "none";
+ char val[GRUB_GPT_GUID_STR_LEN + 1] = "none";
if (dev->disk && dev->disk->partition)
{
struct grub_partition *p = dev->disk->partition;
@@ -130,14 +130,7 @@ grub_cmd_probe (grub_extcmd_context_t ctxt, int argc, char
**args)
return grub_errno;
}
guid = &entry.guid;
- grub_snprintf (val, sizeof(val),
- "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
- grub_le_to_cpu32 (guid->data1),
- grub_le_to_cpu16 (guid->data2),
- grub_le_to_cpu16 (guid->data3),
- guid->data4[0], guid->data4[1], guid->data4[2],
- guid->data4[3], guid->data4[4], guid->data4[5],
- guid->data4[6], guid->data4[7]);
+ grub_gpt_part_guid_snprint (val, sizeof(val), guid);
}
else if (grub_strcmp(dev->disk->partition->partmap->name, "msdos") ==
0)
{
--
2.39.2
- [PATCH v2 3/7] Add a module for the Boot Loader Interface, (continued)
- [PATCH v2 3/7] Add a module for the Boot Loader Interface, Oliver Steffen, 2023/02/20
- [PATCH v2 1/7] efi: add grub_efi_set_variable_with_attributes, Oliver Steffen, 2023/02/20
- [PATCH v2 4/7] util/grub.d: activate bli module on EFI, Oliver Steffen, 2023/02/20
- [PATCH v2 2/7] efi: check for integer overflow in string conversion, Oliver Steffen, 2023/02/20
- [PATCH v2 7/7] commands/bli: use grub_gpt_part_guid_snprint, Oliver Steffen, 2023/02/20
- [PATCH v2 6/7] commands/probe: use grub_gpt_part_guid_snprint,
Oliver Steffen <=
- [PATCH v2 5/7] partmap/gpt: add print function for guids, Oliver Steffen, 2023/02/20