aboutsummaryrefslogtreecommitdiff
path: root/e2fsprogs/e2p/parse_num.c
diff options
context:
space:
mode:
Diffstat (limited to 'e2fsprogs/e2p/parse_num.c')
-rw-r--r--e2fsprogs/e2p/parse_num.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/e2fsprogs/e2p/parse_num.c b/e2fsprogs/e2p/parse_num.c
index 3910e70de..81c160544 100644
--- a/e2fsprogs/e2p/parse_num.c
+++ b/e2fsprogs/e2p/parse_num.c
@@ -1,8 +1,8 @@
1/* 1/*
2 * parse_num.c - Parse the number of blocks 2 * parse_num.c - Parse the number of blocks
3 * 3 *
4 * Copyright (C) 2004,2005 Theodore Ts'o <tytso@mit.edu> 4 * Copyright (C) 2004,2005 Theodore Ts'o <tytso@mit.edu>
5 * 5 *
6 * This file can be redistributed under the terms of the GNU Library General 6 * This file can be redistributed under the terms of the GNU Library General
7 * Public License 7 * Public License
8 */ 8 */
@@ -18,25 +18,25 @@ unsigned long parse_num_blocks(const char *arg, int log_block_size)
18 18
19 num = strtoull(arg, &p, 0); 19 num = strtoull(arg, &p, 0);
20 20
21 if (p[0] && p[1]) 21 if (p[0] && p[1])
22 return 0; 22 return 0;
23 23
24 switch (*p) { /* Using fall-through logic */ 24 switch (*p) { /* Using fall-through logic */
25 case 'T': case 't': 25 case 'T': case 't':
26 num <<= 10; 26 num <<= 10;
27 case 'G': case 'g': 27 case 'G': case 'g':
28 num <<= 10; 28 num <<= 10;
29 case 'M': case 'm': 29 case 'M': case 'm':
30 num <<= 10; 30 num <<= 10;
31 case 'K': case 'k': 31 case 'K': case 'k':
32 num >>= log_block_size; 32 num >>= log_block_size;
33 break; 33 break;
34 case 's': 34 case 's':
35 num >>= 1; 35 num >>= 1;
36 break; 36 break;
37 case '\0': 37 case '\0':
38 break; 38 break;
39 default: 39 default:
40 return 0; 40 return 0;
41 } 41 }
42 return num; 42 return num;