From b471873c34f69a6247652aba6d2d7a232d7db3b8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ga=C3=ABl=20PORTAY?= Date: Sat, 9 Jan 2021 05:03:34 -0500 Subject: [PATCH] libfdisk: (script) ignore empty values for start and size MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Gaël PORTAY --- libfdisk/src/script.c | 7 +++++++ 1 file changed, 7 insertions(+) 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 */ -- 2.47.2