diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2018-07-16 01:47:52 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2019-04-03 12:42:52 -0400 |
commit | 8376d2b04cd11a1a249e6d0bcda39f796da304f6 (patch) | |
tree | 5b0fd6d30fc03f1994ee73255d22fd241244b034 | |
parent | 0fa1189625babea82422cba91b011aba177c5867 (diff) |
bcachefs: Fix __bch2_strtoh
when looking up the unit, it was matching against the trailing null in
si_units
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
-rw-r--r-- | fs/bcachefs/util.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/bcachefs/util.c b/fs/bcachefs/util.c index 24c6cc568762..1272ea7a7a28 100644 --- a/fs/bcachefs/util.c +++ b/fs/bcachefs/util.c @@ -52,7 +52,7 @@ static int __bch2_strtoh(const char *cp, u64 *res, cp++; } while (isdigit(*cp)); - for (u = 1; u < ARRAY_SIZE(si_units); u++) + for (u = 1; u < strlen(si_units); u++) if (*cp == si_units[u]) { cp++; goto got_unit; |