From 456ebe8f8eee82c467805613f107edd84e73ac26 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Wed, 21 Oct 2015 11:11:17 +0200 Subject: Use ARRAYSIZE macro for non-string array size computation Signed-off-by: Pierre Neidhardt Signed-off-by: Allan McRae --- src/common/util-common.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/common') diff --git a/src/common/util-common.h b/src/common/util-common.h index af2ebdaa..f604e79a 100644 --- a/src/common/util-common.h +++ b/src/common/util-common.h @@ -36,6 +36,8 @@ size_t strtrim(char *str); char *strndup(const char *s, size_t n); #endif +#define ARRAYSIZE(a) (sizeof (a) / sizeof (a[0])) + #endif /* _PM_UTIL_COMMON_H */ /* vim: set noet: */ -- cgit v1.2.3-24-g4f1b