Module: wine Branch: master Commit: 534a3082ef139b58828d9e41946093469ed50d06 URL: https://gitlab.winehq.org/wine/wine/-/commit/534a3082ef139b58828d9e419460934...
Author: Michael Stefaniuc mstefani@winehq.org Date: Fri Jul 1 20:03:51 2022 +0200
wmc: Use ARRAY_SIZE instead of open coding it.
---
tools/wmc/wmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/wmc/wmc.c b/tools/wmc/wmc.c index 7ca339fbeef..f5ff7abcdf9 100644 --- a/tools/wmc/wmc.c +++ b/tools/wmc/wmc.c @@ -158,7 +158,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