summaryrefslogtreecommitdiff
path: root/sbin/ipf
diff options
context:
space:
mode:
authorkstailey <kstailey@cvs.openbsd.org>1997-04-19 19:08:30 +0000
committerkstailey <kstailey@cvs.openbsd.org>1997-04-19 19:08:30 +0000
commitfad3b009df9fdd74b726fd75514c8c8f665f137f (patch)
treeb79078b90b474c3a150f6d716e6001f33214f6bb /sbin/ipf
parentf209289ecc515043fc5ecd2defc109b948043193 (diff)
thorpej:
icmpcode() returns an int, and, more importantly, -1 on failure. So, make this work on systems with unsigned chars by placing the return value of icmpcode() in a temporary variable, checking for failure, and then only setting fil.fr_icode (a char) upon success.
Diffstat (limited to 'sbin/ipf')
-rw-r--r--sbin/ipf/parse.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sbin/ipf/parse.c b/sbin/ipf/parse.c
index aff57227de7..8dc78accd5b 100644
--- a/sbin/ipf/parse.c
+++ b/sbin/ipf/parse.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.c,v 1.11 1997/04/06 19:52:11 millert Exp $ */
+/* $OpenBSD: parse.c,v 1.12 1997/04/19 19:08:29 kstailey Exp $ */
/*
* (C)opyright 1993-1996 by Darren Reed.
*
@@ -110,13 +110,15 @@ char *line;
fil.fr_flags |= FR_RETICMP;
cpp++;
if (*(*cpp + 11) == '(') {
- fil.fr_icode = icmpcode(*cpp + 12);
- if (fil.fr_icode == -1) {
+ int icode = icmpcode(*cpp + 12);
+
+ if (icode == -1) {
fprintf(stderr,
- "uncrecognised icmp code %s\n",
+ "unrecognized icmp code %s\n",
*cpp + 12);
return NULL;
}
+ fil.fr_icode = icode;
}
} else if (!strncasecmp(*(cpp+1), "return-rst", 10)) {
fil.fr_flags |= FR_RETRST;