From d053eb8096a790d81b67c844d918341e797c2659 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Mon, 6 Jan 2020 03:28:28 +0100 Subject: Cleanup: use parse_size function to parse compressor options The XZ option parser had a similar function to parse_size. This commit removes the other implementation and extends parse_size with the one missing feature, i.e. allowing a '%' suffix for a relative value. Signed-off-by: David Oberhollenzer --- mkfs/options.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mkfs') diff --git a/mkfs/options.c b/mkfs/options.c index 1fe6081..c063e7c 100644 --- a/mkfs/options.c +++ b/mkfs/options.c @@ -186,7 +186,7 @@ void process_command_line(options_t *opt, int argc, char **argv) break; case 'b': if (parse_size("Block size", &opt->cfg.block_size, - optarg)) { + optarg, 0)) { exit(EXIT_FAILURE); } break; @@ -198,7 +198,7 @@ void process_command_line(options_t *opt, int argc, char **argv) break; case 'B': if (parse_size("Device block size", - &opt->cfg.devblksize, optarg)) { + &opt->cfg.devblksize, optarg, 0)) { exit(EXIT_FAILURE); } if (opt->cfg.devblksize < 1024) { -- cgit v1.2.3