From 191bc277a1584c283a9e4a3c9059e6c4ce26482e Mon Sep 17 00:00:00 2001 From: Michael Stefaniuc Date: Fri, 1 Jul 2022 20:04:19 +0200 Subject: [PATCH] wrc: Use ARRAY_SIZE instead of open coding it. --- tools/wrc/wrc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/wrc/wrc.c b/tools/wrc/wrc.c index c3dfa418571..2448fff11eb 100644 --- a/tools/wrc/wrc.c +++ b/tools/wrc/wrc.c @@ -302,7 +302,7 @@ static void init_argv0_dir( const char *argv0 ) static int pathname[] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 }; size_t path_size = PATH_MAX; char *path = xmalloc( path_size ); - if (!sysctl( pathname, sizeof(pathname)/sizeof(pathname[0]), path, &path_size, NULL, 0 )) + if (!sysctl( pathname, ARRAY_SIZE(pathname), path, &path_size, NULL, 0 )) dir = realpath( path, NULL ); free( path ); #else