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 --- tar/tar2sqfs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tar') diff --git a/tar/tar2sqfs.c b/tar/tar2sqfs.c index facef07..12055c3 100644 --- a/tar/tar2sqfs.c +++ b/tar/tar2sqfs.c @@ -124,12 +124,14 @@ static void process_args(int argc, char **argv) no_tail_pack = true; break; case 'b': - if (parse_size("Block size", &cfg.block_size, optarg)) + if (parse_size("Block size", &cfg.block_size, + optarg, 0)) { exit(EXIT_FAILURE); + } break; case 'B': if (parse_size("Device block size", &cfg.devblksize, - optarg)) { + optarg, 0)) { exit(EXIT_FAILURE); } if (cfg.devblksize < 1024) { -- cgit v1.2.3