summaryrefslogtreecommitdiffstats
path: root/iptables.c
diff options
context:
space:
mode:
authorMartin Josefsson <gandalf@wlug.westbo.se>2005-01-03 07:46:07 +0000
committerMartin Josefsson <gandalf@wlug.westbo.se>2005-01-03 07:46:07 +0000
commit93911bff59ec6a7711091dddfbbb38d912ef517b (patch)
treeaa2264597fdb64679dcc7e98ef27f80e38543aec /iptables.c
parent3aef54dce4f9bbe0b466478fd33a1d3131efbbb8 (diff)
Replace memchr with strlen and fix up one of the statements.
Diffstat (limited to 'iptables.c')
-rw-r--r--iptables.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/iptables.c b/iptables.c
index 3cedaccf..7144b393 100644
--- a/iptables.c
+++ b/iptables.c
@@ -1090,8 +1090,8 @@ register_match(struct iptables_match *me)
exit(1);
}
- /* Revision field stole a char: check for 30 char names. */
- if (!memchr(me->name, 0, IPT_FUNCTION_MAXNAMELEN-1)) {
+ /* Revision field stole a char from name. */
+ if (strlen(me->name) >= IPT_FUNCTION_MAXNAMELEN-1) {
fprintf(stderr, "%s: target `%s' has invalid name\n",
program_name, me->name);
exit(1);
@@ -1146,8 +1146,8 @@ register_target(struct iptables_target *me)
exit(1);
}
- /* Revision field stole a char: check for 30 char names. */
- if (!memchr(me->name, 0, IPT_FUNCTION_MAXNAMELEN)) {
+ /* Revision field stole a char from name. */
+ if (strlen(me->name) >= IPT_FUNCTION_MAXNAMELEN-1) {
fprintf(stderr, "%s: target `%s' has invalid name\n",
program_name, me->name);
exit(1);