libfdisk: (script) ignore empty values for start and size

Signed-off-by: Gaël PORTAY <gael.portay@collabora.com>
This commit is contained in:
Gaël PORTAY 2021-01-09 05:03:34 -05:00
parent 62df539554
commit ecdfb2b767
1 changed files with 7 additions and 0 deletions

View 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> */