From: Kamalesh Babulal Date: Tue, 8 Aug 2023 10:16:03 +0000 (+0530) Subject: src/api.c: use ARRAY_SIZE() macro X-Git-Tag: v3.2.0~242 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=50af3f4e060c5404b2da80254f88194a15865d6e;p=thirdparty%2Flibcgroup.git 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 --- 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];