From ecdfb2b767fc8ac6f27d67536d38997479172dc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?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=UTF-8 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 6e6f26321..c3d8eb547 100644 --- a/libfdisk/src/script.c +++ b/libfdisk/src/script.c @@ -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 */ @@ -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 */