summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorDaniel Hartmeier <dhartmei@cvs.openbsd.org>2006-03-21 03:31:10 +0000
committerDaniel Hartmeier <dhartmei@cvs.openbsd.org>2006-03-21 03:31:10 +0000
commit0fe995ebad8edfd2ecfec6406e793fcf088f9f01 (patch)
tree45797a475d486ac1c3e0d43d2e69721957079b8b /sbin
parentfc32c0f1601be362ed82dfd717791abafba73746 (diff)
instead of sizeof(array) / sizeof(element) computation, use the existing
end-of-array NULL marker, shuts up source analysis tool, from deraadt@
Diffstat (limited to 'sbin')
-rw-r--r--sbin/pfctl/pfctl_parser.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c
index 5f0069ab721..a00e74b3f9d 100644
--- a/sbin/pfctl/pfctl_parser.c
+++ b/sbin/pfctl/pfctl_parser.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl_parser.c,v 1.222 2005/11/04 08:24:15 mcbride Exp $ */
+/* $OpenBSD: pfctl_parser.c,v 1.223 2006/03/21 03:31:09 dhartmei Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -921,12 +921,13 @@ print_rule(struct pf_rule *r, const char *anchor_call, int verbose)
if (!opts)
printf(", ");
opts = 0;
- for (j = 0; j < sizeof(pf_timeouts) /
- sizeof(pf_timeouts[0]); ++j)
+ for (j = 0; pf_timeouts[j].name != NULL;
+ ++j)
if (pf_timeouts[j].timeout == i)
break;
- printf("%s %u", j == PFTM_MAX ? "inv.timeout" :
- pf_timeouts[j].name, r->timeout[i]);
+ printf("%s %u", pf_timeouts[j].name == NULL ?
+ "inv.timeout" : pf_timeouts[j].name,
+ r->timeout[i]);
}
printf(")");
}