summaryrefslogtreecommitdiff
path: root/utils.c
diff options
context:
space:
mode:
authorZach Brown <zab@redhat.com>2013-01-22 15:11:55 -0800
committerZach Brown <zab@redhat.com>2013-02-05 16:09:39 -0800
commitaaf682ac2e6f0126305a149bccb4b5798fd6ffe4 (patch)
treef397f544cec33a633c72dee028bc0a34220ea8d6 /utils.c
parent7d365c5a87cdb542c204086b4d1d7aa00cd7b09f (diff)
btrfs-progs: array indexes must be < ARRAY_SIZE()
It looks like the usual kernel idiom of "< ARRAY_SIZE()" was accidentally negated as ">" instead of ">=". Signed-off-by: Zach Brown <zab@redhat.com>
Diffstat (limited to 'utils.c')
-rw-r--r--utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/utils.c b/utils.c
index d2dec6fd..4b05961b 100644
--- a/utils.c
+++ b/utils.c
@@ -1118,7 +1118,7 @@ char *pretty_sizes(u64 size)
num_divs ++;
}
- if (num_divs > ARRAY_SIZE(size_strs))
+ if (num_divs >= ARRAY_SIZE(size_strs))
return NULL;
fraction = (float)last_size / 1024;
}