From: Christian Goeschel Ndjomouo Date: Tue, 31 Mar 2026 15:59:13 +0000 (-0400) Subject: tests: (test_strerror.c) use ARRAY_SIZE for better readability/portability X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c98ad3660fcdaa5c63cf8a2def3d7cc2f60772c0;p=thirdparty%2Futil-linux.git tests: (test_strerror.c) use ARRAY_SIZE for better readability/portability Signed-off-by: Christian Goeschel Ndjomouo --- diff --git a/tests/helpers/test_strerror.c b/tests/helpers/test_strerror.c index 7fcba1fed..3775a46a3 100644 --- a/tests/helpers/test_strerror.c +++ b/tests/helpers/test_strerror.c @@ -13,6 +13,8 @@ #include #include +#include "c.h" + #define E(x) { #x, x } static struct { const char *str; @@ -34,7 +36,7 @@ int main(int argc, const char *argv[]) return -1; } - for (i = 0; i < sizeof(errors)/sizeof(*errors); i++) { + for (i = 0; i < ARRAY_SIZE(errors); i++) { if (strcmp(errors[i].str, argv[1]) != 0) continue; puts(strerror(errors[i].error));