]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
gpt: introduce GPT_LAVEL_MAX
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 12 May 2021 01:16:36 +0000 (10:16 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 12 May 2021 01:16:36 +0000 (10:16 +0900)
src/shared/gpt.c
src/shared/gpt.h

index 558b69c48793400500dc41de2d4589018307c1b1..bd1f43ffdd42320945041c41e07c0a36f2ca03fa 100644 (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) {
index 6581973793d66fe9cf6e2dab3648edfe003321bd..c92d9c0974cb2d5e6707e85d7ef72e732698ed7c 100644 (file)
 #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,