From 04163c6a0f9b843b34ad9bd2a22a8360a116f81e Mon Sep 17 00:00:00 2001 From: kstailey Date: Sat, 19 Apr 1997 19:08:29 +0000 Subject: [PATCH] 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. --- sbin/ipf/parse.c | 10 ++++++---- 1 file 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; -- 2.20.1