mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-05 14:09:48 +01:00
ipfw: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])
Pull Request: https://github.com/freebsd/freebsd-src/pull/888 Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
This commit is contained in:
parent
b561d8f59c
commit
c3c816173d
@ -22,7 +22,7 @@
|
||||
|
||||
#define NEW_AQM
|
||||
#include <sys/limits.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/socket.h>
|
||||
/* XXX there are several sysctl leftover here */
|
||||
#include <sys/sysctl.h>
|
||||
@ -1401,7 +1401,7 @@ ipfw_config_pipe(int ac, char **av)
|
||||
*/
|
||||
if (p)
|
||||
p->bandwidth = -1;
|
||||
for (j = 0; j < sizeof(fs->par)/sizeof(fs->par[0]); j++)
|
||||
for (j = 0; j < nitems(fs->par); j++)
|
||||
fs->par[j] = -1;
|
||||
while (ac > 0) {
|
||||
double d;
|
||||
|
@ -4035,8 +4035,8 @@ compile_rule(char *av[], uint32_t *rbuf, int *rbufsize, struct tidx *tstate)
|
||||
|
||||
rblen = *rbufsize / sizeof(uint32_t);
|
||||
rblen -= sizeof(struct ip_fw_rule) / sizeof(uint32_t);
|
||||
ablen = sizeof(actbuf) / sizeof(actbuf[0]);
|
||||
cblen = sizeof(cmdbuf) / sizeof(cmdbuf[0]);
|
||||
ablen = nitems(actbuf);
|
||||
cblen = nitems(cmdbuf);
|
||||
cblen -= F_INSN_SIZE(ipfw_insn_u32) + 1;
|
||||
|
||||
#define CHECK_RBUFLEN(len) { CHECK_LENGTH(rblen, len); rblen -= len; }
|
||||
|
Loading…
Reference in New Issue
Block a user