gpt: introduce GPT_LAVEL_MAX

This commit is contained in:
Yu Watanabe
2021-05-12 10:16:36 +09:00
parent f4767dc081
commit 6001df6594
2 changed files with 4 additions and 1 deletions
+1 -1
View File
@@ -104,7 +104,7 @@ int gpt_partition_label_valid(const char *s) {
if (!recoded)
return -ENOMEM;
return char16_strlen(recoded) <= 36;
return char16_strlen(recoded) <= GPT_LABEL_MAX;
}
bool gpt_partition_type_is_root(sd_id128_t id) {
+3
View File
@@ -115,6 +115,9 @@
#define GPT_FLAG_NO_AUTO (1ULL << 63)
#define GPT_FLAG_GROWFS (1ULL << 59)
/* maximum length of gpt label */
#define GPT_LABEL_MAX 36
const char *gpt_partition_type_uuid_to_string(sd_id128_t id);
const char *gpt_partition_type_uuid_to_string_harder(
sd_id128_t id,