From 20ae9b49848ceb416966fbfddbab9bb403cf2678 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Mon, 16 Jul 2018 01:47:52 -0400 Subject: bcachefs: Fix __bch2_strtoh when looking up the unit, it was matching against the trailing null in si_units Signed-off-by: Kent Overstreet --- fs/bcachefs/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- cgit v1.2.3