From 50af3f4e060c5404b2da80254f88194a15865d6e Mon Sep 17 00:00:00 2001 From: Kamalesh Babulal Date: Tue, 8 Aug 2023 15:46:03 +0530 Subject: [PATCH] src/api.c: use ARRAY_SIZE() macro Use ARRAY_SIZE() macro to calculate the length of the array, across the file. Signed-off-by: Kamalesh Babulal Signed-off-by: Tom Hromatka --- src/api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api.c b/src/api.c index f2991a40..4bfaf011 100644 --- a/src/api.c +++ b/src/api.c @@ -4994,7 +4994,7 @@ const char *cgroup_strerror(int code) "unknown error" : errtext; #endif } - if (idx >= sizeof(cgroup_strerror_codes)/sizeof(cgroup_strerror_codes[0])) + if (idx >= ARRAY_SIZE(cgroup_strerror_codes)) return "Invalid error code"; return cgroup_strerror_codes[idx]; -- 2.47.2