From: Gaël PORTAY Date: Sat, 9 Jan 2021 10:03:34 +0000 (-0500) Subject: libfdisk: (script) ignore empty values for start and size X-Git-Tag: v2.36.2~27 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=b471873c34f69a6247652aba6d2d7a232d7db3b8;p=thirdparty%2Futil-linux.git libfdisk: (script) ignore empty values for start and size Signed-off-by: Gaël PORTAY --- diff --git a/libfdisk/src/script.c b/libfdisk/src/script.c index 56bac651da..6bbe8178f5 100644 --- a/libfdisk/src/script.c +++ b/libfdisk/src/script.c @@ -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 */ @@ -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 */