diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-10-17 23:23:45 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-10-17 23:23:45 +0200 |
commit | 7d8ab846d1f6044cc6c1fc5e3b1a586a9d78637c (patch) | |
tree | 1501d65c0e5329f4b0d433f47332be815b0d916c | |
parent | 45887751827cb6316218536937ac846b1b062661 (diff) | |
download | busybox-w32-7d8ab846d1f6044cc6c1fc5e3b1a586a9d78637c.tar.gz busybox-w32-7d8ab846d1f6044cc6c1fc5e3b1a586a9d78637c.tar.bz2 busybox-w32-7d8ab846d1f6044cc6c1fc5e3b1a586a9d78637c.zip |
mkfs_ext2: fix a buglet introduced in last commit
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | util-linux/mkfs_ext2.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/util-linux/mkfs_ext2.c b/util-linux/mkfs_ext2.c index e4c3e171e..41f37c287 100644 --- a/util-linux/mkfs_ext2.c +++ b/util-linux/mkfs_ext2.c | |||
@@ -112,11 +112,14 @@ static uint32_t has_super(uint32_t x) | |||
112 | 48828125, 129140163, 244140625, 282475249, 387420489, | 112 | 48828125, 129140163, 244140625, 282475249, 387420489, |
113 | 1162261467, 1220703125, 1977326743, 3486784401/* >2^31 */, | 113 | 1162261467, 1220703125, 1977326743, 3486784401/* >2^31 */, |
114 | }; | 114 | }; |
115 | unsigned i; | 115 | const uint32_t *sp = supers + ARRAY_SIZE(supers)-1; |
116 | for (i = ARRAY_SIZE(supers); --i >= 0;) | 116 | while (1) { |
117 | if (x == supers[i]) | 117 | if (x == *sp) |
118 | return 1; | 118 | return 1; |
119 | return 0; | 119 | if (0 == *sp) |
120 | return 0; | ||
121 | sp--; | ||
122 | } | ||
120 | } | 123 | } |
121 | #endif | 124 | #endif |
122 | 125 | ||