aboutsummaryrefslogtreecommitdiff
path: root/tar
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-01-02 18:50:26 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-01-02 18:50:26 +0100
commit8a0b1d0eff21fc8f0b6007107490d7064af5bacb (patch)
tree7415d398692285106c1bca95f901798334765074 /tar
parent027a17b2714c7db6c1824142547afaa0d1ee27e8 (diff)
Support parsing [device] block size argument with SI suffix
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'tar')
-rw-r--r--tar/tar2sqfs.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/tar/tar2sqfs.c b/tar/tar2sqfs.c
index f522239..facef07 100644
--- a/tar/tar2sqfs.c
+++ b/tar/tar2sqfs.c
@@ -124,10 +124,14 @@ static void process_args(int argc, char **argv)
no_tail_pack = true;
break;
case 'b':
- cfg.block_size = strtol(optarg, NULL, 0);
+ if (parse_size("Block size", &cfg.block_size, optarg))
+ exit(EXIT_FAILURE);
break;
case 'B':
- cfg.devblksize = strtol(optarg, NULL, 0);
+ if (parse_size("Device block size", &cfg.devblksize,
+ optarg)) {
+ exit(EXIT_FAILURE);
+ }
if (cfg.devblksize < 1024) {
fputs("Device block size must be at "
"least 1024\n", stderr);