From: Matthieu Dupont Date: Sun, 15 Nov 2015 15:24:54 +0000 (+0100) Subject: make2fs: parse a human readable inode ratio for the -i option X-Git-Tag: v1.43-WIP-2016-03-15~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=79ffbf251e9795c685407b0baabe8a1721ec6909;p=thirdparty%2Fe2fsprogs.git make2fs: parse a human readable inode ratio for the -i option Signed-off-by: Matthieu Dupont Signed-off-by: Theodore Ts'o --- diff --git a/misc/mke2fs.c b/misc/mke2fs.c index 9a2a6cce4..800a96888 100644 --- a/misc/mke2fs.c +++ b/misc/mke2fs.c @@ -1641,10 +1641,9 @@ profile_error: } break; case 'i': - inode_ratio = strtoul(optarg, &tmp, 0); + inode_ratio = parse_num_blocks(optarg, -1); if (inode_ratio < EXT2_MIN_BLOCK_SIZE || - inode_ratio > EXT2_MAX_BLOCK_SIZE * 1024 || - *tmp) { + inode_ratio > EXT2_MAX_BLOCK_SIZE * 1024) { com_err(program_name, 0, _("invalid inode ratio %s (min %d/max %d)"), optarg, EXT2_MIN_BLOCK_SIZE,