diff options
author | Tom Rini <trini@konsulko.com> | 2021-01-18 07:55:54 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-01-18 07:55:54 -0500 |
commit | 19c5fdffdc41bfd606b455b46e834d1bff4b2c1e (patch) | |
tree | db1c5abebf12e9aaef80d8e22a472357027b5287 /lib/uuid.c | |
parent | 14ea1b3635b4af8d9e283e3671f7ee872d50b859 (diff) | |
parent | ad80a8d0877922db95fd0410314504c840d9d850 (diff) |
Merge branch '2021-01-16-assorted-improvements'
- Assorted testing improvements and fixes
- Assorted code cleanups
Diffstat (limited to 'lib/uuid.c')
-rw-r--r-- | lib/uuid.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/uuid.c b/lib/uuid.c index e62d5ca264..54a93aacc9 100644 --- a/lib/uuid.c +++ b/lib/uuid.c @@ -96,7 +96,8 @@ static const struct { {"linux", PARTITION_LINUX_FILE_SYSTEM_DATA_GUID}, {"raid", PARTITION_LINUX_RAID_GUID}, {"swap", PARTITION_LINUX_SWAP_GUID}, - {"lvm", PARTITION_LINUX_LVM_GUID} + {"lvm", PARTITION_LINUX_LVM_GUID}, + {"u-boot-env", PARTITION_U_BOOT_ENVIRONMENT}, }; /* @@ -122,20 +123,19 @@ int uuid_guid_get_bin(const char *guid_str, unsigned char *guid_bin) * uuid_guid_get_str() - this function get string for GUID. * * @param guid_bin - pointer to string with partition type guid [16B] - * @param guid_str - pointer to allocated partition type string [7B] + * + * Returns NULL if the type GUID is not known. */ -int uuid_guid_get_str(const unsigned char *guid_bin, char *guid_str) +const char *uuid_guid_get_str(const unsigned char *guid_bin) { int i; - *guid_str = 0; for (i = 0; i < ARRAY_SIZE(list_guid); i++) { if (!memcmp(list_guid[i].guid.b, guid_bin, 16)) { - strcpy(guid_str, list_guid[i].string); - return 0; + return list_guid[i].string; } } - return -ENODEV; + return NULL; } #endif |