Use nitems() macro instead of __arraycount()
This commit is contained in:
parent
1272c4aad2
commit
708694f704
@ -17,15 +17,14 @@ __stack_chk_fail(void)
|
||||
panic("stack overflow detected; backtrace may be corrupted");
|
||||
}
|
||||
|
||||
#define __arraycount(__x) (sizeof(__x) / sizeof(__x[0]))
|
||||
static void
|
||||
__stack_chk_init(void *dummy __unused)
|
||||
{
|
||||
size_t i;
|
||||
long guard[__arraycount(__stack_chk_guard)];
|
||||
long guard[nitems(__stack_chk_guard)];
|
||||
|
||||
arc4rand(guard, sizeof(guard), 0);
|
||||
for (i = 0; i < __arraycount(guard); i++)
|
||||
for (i = 0; i < nitems(guard); i++)
|
||||
__stack_chk_guard[i] = guard[i];
|
||||
}
|
||||
SYSINIT(stack_chk, SI_SUB_RANDOM, SI_ORDER_ANY, __stack_chk_init, NULL);
|
||||
|
Loading…
x
Reference in New Issue
Block a user