Signed-off-by: Karel Zak <kzak@redhat.com>
gpt = self_label(cxt);
old = le32_to_cpu(gpt->pheader->npartition_entries);
+ if (old == new)
+ return 0; /* do nothing, say nothing */
/* calculate the size (bytes) of the entries array */
new_size = new * le32_to_cpu(gpt->pheader->sizeof_partition_entry);
return rc;
str = fdisk_script_get_header(dp, "table-length");
- if (str)
- return fdisk_gpt_set_npartitions(cxt, strtoul(str, NULL, 0));
+ if (str) {
+ uintmax_t sz;
- return 0;
+ rc = parse_size(str, &sz, NULL);
+ if (rc == 0)
+ rc = fdisk_gpt_set_npartitions(cxt, sz);
+ }
+
+ return rc;
}
/**