From: Jan Kara Date: Mon, 25 Feb 2013 05:55:05 +0000 (+0000) Subject: e2p: Fix 's' handling in parse_num_blocks2() X-Git-Tag: v1.42.8~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9e20cf223ad6e44536f7e3116413cc8a445618c7;p=thirdparty%2Fe2fsprogs.git e2p: Fix 's' handling in parse_num_blocks2() parse_num_blocks2() wrongly did: num << 1; when log_block_size < 0. That is obviously wrong as such statement has no effect (and the compiler properly warns about it). Callers expect returned value to be in bytes when log_block_size < 0 so fix the statement accordingly. Signed-off-by: Jan Kara Signed-off-by: Theodore Ts'o --- diff --git a/lib/e2p/parse_num.c b/lib/e2p/parse_num.c index cb0dc5b42..e8d6283ca 100644 --- a/lib/e2p/parse_num.c +++ b/lib/e2p/parse_num.c @@ -42,7 +42,7 @@ unsigned long long parse_num_blocks2(const char *arg, int log_block_size) break; case 's': if (log_block_size < 0) - num << 1; + num <<= 9; else num >>= (1+log_block_size); break;