diff options
author | Phil Sutter <phil@nwl.cc> | 2019-10-17 23:55:02 +0200 |
---|---|---|
committer | Phil Sutter <phil@nwl.cc> | 2019-10-23 14:05:17 +0200 |
commit | ffb339224f71871d015e4b57ea8dbaf9fd4f8aad (patch) | |
tree | 5b2bfd8420c37682a08039a4ac2d348e29fb7ce1 | |
parent | 4e470fa34761085144640fb561a9ad26b2cde382 (diff) | |
download | platform_external_iptables-ffb339224f71871d015e4b57ea8dbaf9fd4f8aad.tar.gz platform_external_iptables-ffb339224f71871d015e4b57ea8dbaf9fd4f8aad.tar.bz2 platform_external_iptables-ffb339224f71871d015e4b57ea8dbaf9fd4f8aad.zip |
nft: Use ARRAY_SIZE() macro in nft_strerror()
Variable 'table' is an array of type struct table_struct, so this is a
classical use-case for ARRAY_SIZE() macro.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r-- | iptables/nft.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/iptables/nft.c b/iptables/nft.c index 89b1c7a8..3c230c12 100644 --- a/iptables/nft.c +++ b/iptables/nft.c @@ -2888,7 +2888,7 @@ const char *nft_strerror(int err) { NULL, ENOENT, "No chain/target/match by that name" }, }; - for (i = 0; i < sizeof(table)/sizeof(struct table_struct); i++) { + for (i = 0; i < ARRAY_SIZE(table); i++) { if ((!table[i].fn || table[i].fn == nft_fn) && table[i].err == err) return table[i].message; |