summaryrefslogtreecommitdiffstats
path: root/extensions/libxt_hashlimit.c
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2009-04-30 19:32:02 +0200
committerJan Engelhardt <jengelh@medozas.de>2009-05-26 13:14:15 +0200
commit2c69b55e55f2efc5a334b87ccdceaa9de0ecb658 (patch)
treef68c86d49be428f2e46f483eec0b36d01a15e311 /extensions/libxt_hashlimit.c
parent69f564e3890976461de0016cd81171ff8bfa8353 (diff)
iptables: replace open-coded sizeof by ARRAY_SIZE
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Diffstat (limited to 'extensions/libxt_hashlimit.c')
-rw-r--r--extensions/libxt_hashlimit.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/extensions/libxt_hashlimit.c b/extensions/libxt_hashlimit.c
index aa56c652..84dd7868 100644
--- a/extensions/libxt_hashlimit.c
+++ b/extensions/libxt_hashlimit.c
@@ -485,11 +485,10 @@ static void print_rate(u_int32_t period)
{
unsigned int i;
- for (i = 1; i < sizeof(rates)/sizeof(struct rates); i++) {
+ for (i = 1; i < ARRAY_SIZE(rates); ++i)
if (period > rates[i].mult
|| rates[i].mult/period < rates[i].mult%period)
break;
- }
printf("%u/%s ", rates[i-1].mult / period, rates[i-1].name);
}