]> Git Repo - J-u-boot.git/blobdiff - cmd/gpt.c
Merge tag 'v2023.10-rc4' into next
[J-u-boot.git] / cmd / gpt.c
index fe9e06681ce2948de6ee3771437f82b6c4705cfa..3cc6436b28b07aeab2c046d1f97b80c9297dba60 100644 (file)
--- a/cmd/gpt.c
+++ b/cmd/gpt.c
@@ -211,12 +211,10 @@ static struct disk_part *allocate_disk_part(struct disk_partition *info,
                PART_TYPE_LEN);
        newpart->gpt_part_info.type[PART_TYPE_LEN - 1] = '\0';
        newpart->gpt_part_info.bootable = info->bootable;
-#ifdef CONFIG_PARTITION_UUIDS
-       strncpy(newpart->gpt_part_info.uuid, (const char *)info->uuid,
-               UUID_STR_LEN);
-       /* UUID_STR_LEN is correct, as uuid[]'s length is UUID_STR_LEN+1 chars */
-       newpart->gpt_part_info.uuid[UUID_STR_LEN] = '\0';
-#endif
+       if (IS_ENABLED(CONFIG_PARTITION_UUIDS)) {
+               strlcpy(newpart->gpt_part_info.uuid, disk_partition_uuid(info),
+                       UUID_STR_LEN + 1);
+       }
        newpart->partnum = partnum;
 
        return newpart;
This page took 0.024171 seconds and 4 git commands to generate.