From 456ebe8f8eee82c467805613f107edd84e73ac26 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Wed, 21 Oct 2015 11:11:17 +0200 Subject: Use ARRAYSIZE macro for non-string array size computation Signed-off-by: Pierre Neidhardt Signed-off-by: Allan McRae --- src/pacman/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/pacman/util.c') 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; -- cgit v1.2.3-24-g4f1b