mirror of https://github.com/mkerrisk/man-pages
seccomp.2: Use ARRAY_SIZE() macro instead of raw sizeof division
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
c9cedb53b2
commit
59a1988b25
|
@ -1051,6 +1051,7 @@ cecilia
|
|||
#include <sys/prctl.h>
|
||||
|
||||
#define X32_SYSCALL_BIT 0x40000000
|
||||
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
|
||||
|
||||
static int
|
||||
install_filter(int syscall_nr, int t_arch, int f_errno)
|
||||
|
@ -1101,7 +1102,7 @@ install_filter(int syscall_nr, int t_arch, int f_errno)
|
|||
};
|
||||
|
||||
struct sock_fprog prog = {
|
||||
.len = sizeof(filter) / sizeof(filter[0]),
|
||||
.len = ARRAY_SIZE(filter),
|
||||
.filter = filter,
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue