summaryrefslogtreecommitdiff
path: root/src/pacman/util.c
diff options
context:
space:
mode:
authorPierre Neidhardt <ambrevar@gmail.com>2015-10-21 11:11:17 +0200
committerAllan McRae <allan@archlinux.org>2015-10-27 13:53:18 +1000
commit456ebe8f8eee82c467805613f107edd84e73ac26 (patch)
treeda9a058a2e598d7dbf2efd9c61d9107eb9c5eb31 /src/pacman/util.c
parent9809102237f89b73a120250260bf3f68d6bc4ba9 (diff)
Use ARRAYSIZE macro for non-string array size computation
Signed-off-by: Pierre Neidhardt <ambrevar@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'src/pacman/util.c')
-rw-r--r--src/pacman/util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pacman/util.c b/src/pacman/util.c
index 1542f8a2..5f331e82 100644
--- a/src/pacman/util.c
+++ b/src/pacman/util.c
@@ -1075,7 +1075,7 @@ double humanize_size(off_t bytes, const char target_unit, int precision,
{
static const char *labels[] = {"B", "KiB", "MiB", "GiB",
"TiB", "PiB", "EiB", "ZiB", "YiB"};
- static const int unitcount = sizeof(labels) / sizeof(labels[0]);
+ static const int unitcount = ARRAYSIZE(labels);
double val = (double)bytes;
int index;