]> 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)
committerGaël PORTAY <gael.portay@collabora.com>
Sat, 9 Jan 2021 10:23:41 +0000 (05:23 -0500)
Signed-off-by: Gaël PORTAY <gael.portay@collabora.com>
libfdisk/src/script.c

index 6e6f263218007169dfe317c2ca27ea25a4d8044c..c3d8eb547b4e64095c0fe86f362ce64415d0479e 100644 (file)
@@ -1038,7 +1038,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> */
@@ -1055,6 +1059,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> */