From b3608ae18f1e5598bed81d0a10dd585a5080c40d Mon Sep 17 00:00:00 2001 From: Ed Schouten Date: Tue, 3 Jan 2012 18:51:58 +0000 Subject: Replace index() and rindex() calls with strchr() and strrchr(). The index() and rindex() functions were marked LEGACY in the 2001 revision of POSIX and were subsequently removed from the 2008 revision. The strchr() and strrchr() functions are part of the C standard. This makes the source code a lot more consistent, as most of these C files also call into other str*() routines. In fact, about a dozen already perform strchr() calls. --- usr.sbin/ipfwpcap/ipfwpcap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'usr.sbin/ipfwpcap') diff --git a/usr.sbin/ipfwpcap/ipfwpcap.c b/usr.sbin/ipfwpcap/ipfwpcap.c index c7543ef0b8f0..d579bd94ef01 100644 --- a/usr.sbin/ipfwpcap/ipfwpcap.c +++ b/usr.sbin/ipfwpcap/ipfwpcap.c @@ -87,7 +87,7 @@ okay(int pn) char *p, numbuf[80]; if (pidfile[0] == '\0') { - p = rindex(prog, '/'); + p = strrchr(prog, '/'); p = (p == NULL) ? prog : p + 1; snprintf(pidfile, sizeof pidfile, -- cgit v1.2.3