]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libfdisk: (script) ignore empty values for start and size
authorGaël PORTAY <gael.portay@collabora.com>
Sat, 9 Jan 2021 10:03:34 +0000 (05:03 -0500)
committerKarel Zak <kzak@redhat.com>
Wed, 10 Feb 2021 09:06:32 +0000 (10:06 +0100)
Signed-off-by: Gaël PORTAY <gael.portay@collabora.com>
libfdisk/src/script.c

index 56bac651da10ad71ee90af8c1d93c74135428699..6bbe8178f5be4be9f53268f9e7343b220ec27500 100644 (file)
@@ -1034,7 +1034,11 @@ static int parse_line_nameval(struct fdisk_script *dp, char *s)
 
                if (!strncasecmp(p, "start=", 6)) {
                        int pow = 0;
+
                        p += 6;
+                       if (!*p)
+                               continue;
+
                        rc = next_number(&p, &num, &pow);
                        if (!rc) {
                                if (pow) {      /* specified as <num><suffix> */
@@ -1051,6 +1055,9 @@ static int parse_line_nameval(struct fdisk_script *dp, char *s)
                        int pow = 0;
 
                        p += 5;
+                       if (!*p)
+                               continue;
+
                        rc = next_number(&p, &num, &pow);
                        if (!rc) {
                                if (pow) {      /* specified as <num><suffix> */