diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1997-01-17 07:14:33 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1997-01-17 07:14:33 +0000 |
commit | 3e150a880447536a0af58c395e5a857635e985d3 (patch) | |
tree | 867c3504f60ee9bfd2fa5db3dd66d5b3a1649ecd /sbin/ipf | |
parent | 8e78a24e2e89c03ac53bd758a1781c925fe7ab71 (diff) |
r?index -> strr?chr
Diffstat (limited to 'sbin/ipf')
-rw-r--r-- | sbin/ipf/ipf.c | 17 | ||||
-rw-r--r-- | sbin/ipf/parse.c | 12 |
2 files changed, 13 insertions, 16 deletions
diff --git a/sbin/ipf/ipf.c b/sbin/ipf/ipf.c index 89508c72535..2025449699e 100644 --- a/sbin/ipf/ipf.c +++ b/sbin/ipf/ipf.c @@ -13,9 +13,6 @@ #if !defined(__SVR4) && !defined(__GNUC__) #include <strings.h> #endif -#if !defined(__SVR4) && defined(__GNUC__) -extern char *index(); -#endif #include <sys/types.h> #include <sys/param.h> #include <sys/file.h> @@ -37,7 +34,7 @@ extern char *index(); #ifndef lint static char sccsid[] = "@(#)ipf.c 1.23 6/5/96 (C) 1993-1995 Darren Reed"; -static char rcsid[] = "$Id: ipf.c,v 1.7 1996/10/08 07:33:31 niklas Exp $"; +static char rcsid[] = "$Id: ipf.c,v 1.8 1997/01/17 07:12:16 millert Exp $"; #endif #if SOLARIS @@ -180,14 +177,14 @@ char *name, *file; /* * treat both CR and LF as EOL */ - if ((s = index(line, '\n'))) + if ((s = strchr(line, '\n'))) *s = '\0'; - if ((s = index(line, '\r'))) + if ((s = strchr(line, '\r'))) *s = '\0'; /* * # is comment marker, everything after is a ignored */ - if ((s = index(line, '#'))) + if ((s = strchr(line, '#'))) *s = '\0'; if (!*line) @@ -251,17 +248,17 @@ char *opt; flag = 0; - if (index(opt, 'p')) { + if (strchr(opt, 'p')) { flag |= FF_LOGPASS; if (opts & OPT_VERBOSE) printf("set log flag: pass\n"); } - if (index(opt, 'm') && (*opt == 'n' || *opt == 'N')) { + if (strchr(opt, 'm') && (*opt == 'n' || *opt == 'N')) { flag |= FF_LOGNOMATCH; if (opts & OPT_VERBOSE) printf("set log flag: nomatch\n"); } - if (index(opt, 'b') || index(opt, 'd')) { + if (strchr(opt, 'b') || strchr(opt, 'd')) { flag |= FF_LOGBLOCK; if (opts & OPT_VERBOSE) printf("set log flag: block\n"); diff --git a/sbin/ipf/parse.c b/sbin/ipf/parse.c index 7e9cf1ef551..19e093bf390 100644 --- a/sbin/ipf/parse.c +++ b/sbin/ipf/parse.c @@ -34,7 +34,7 @@ #ifndef lint static char sccsid[] ="@(#)parse.c 1.44 6/5/96 (C) 1993-1996 Darren Reed"; -static char rcsid[] = "$Id: parse.c,v 1.7 1996/10/08 07:33:32 niklas Exp $"; +static char rcsid[] = "$Id: parse.c,v 1.8 1997/01/17 07:12:18 millert Exp $"; #endif extern struct ipopt_names ionames[], secclass[]; @@ -423,7 +423,7 @@ char *to; int r = 0; char *s; - s = index(to, ':'); + s = strchr(to, ':'); fdp->fd_ifp = NULL; if (s) { *s++ = '\0'; @@ -465,13 +465,13 @@ u_char *cp; /* * is it possibly hostname/num ? */ - if ((s = index(**seg, '/'))) { + if ((s = strchr(**seg, '/'))) { *s++ = '\0'; if (!isdigit(*s)) return -1; - if (index(s, '.')) + if (strchr(s, '.')) *msk = inet_addr(s); - if (!index(s, '.') && !index(s, 'x')) { + if (!strchr(s, '.') && !strchr(s, 'x')) { /* * set x most significant bits */ @@ -651,7 +651,7 @@ u_char *mask; fp = &tcpfm; continue; } - if (!(t = index(flagset, *s))) { + if (!(t = strchr(flagset, *s))) { (void)fprintf(stderr, "unknown flag (%c)\n", *s); return 0; } |