Index: bin/ln/ln.c
===================================================================
RCS file: /cvs/src/bin/ln/ln.c,v
retrieving revision 1.3
diff -u -r1.3 ln.c
--- bin/ln/ln.c	19 Mar 2004 17:17:46 -0000	1.3
+++ bin/ln/ln.c	30 Aug 2004 18:17:47 -0000
@@ -71,7 +71,7 @@
 	 * "link", for which the functionality provided is greatly
 	 * simplified.
 	 */
-	if ((p = rindex(argv[0], '/')) == NULL)
+	if ((p = strrchr(argv[0], '/')) == NULL)
 		p = argv[0];
 	else
 		++p;
Index: bin/rm/rm.c
===================================================================
RCS file: /cvs/src/bin/rm/rm.c,v
retrieving revision 1.2
diff -u -r1.2 rm.c
--- bin/rm/rm.c	17 Jun 2003 04:22:50 -0000	1.2
+++ bin/rm/rm.c	30 Aug 2004 18:17:48 -0000
@@ -78,7 +78,7 @@
 	 * "unlink", for which the functionality provided is greatly
 	 * simplified.
 	 */
-	if ((p = rindex(argv[0], '/')) == NULL)
+	if ((p = strrchr(argv[0], '/')) == NULL)
 		p = argv[0];
 	else
 		++p;
Index: bin/test/test.c
===================================================================
RCS file: /cvs/src/bin/test/test.c,v
retrieving revision 1.5
diff -u -r1.5 test.c
--- bin/test/test.c	19 Mar 2004 17:17:45 -0000	1.5
+++ bin/test/test.c	30 Aug 2004 18:17:48 -0000
@@ -197,7 +197,7 @@
 	int	res;
 	char	*p;
 
-	if ((p = rindex(argv[0], '/')) == NULL)
+	if ((p = strrchr(argv[0], '/')) == NULL)
 		p = argv[0];
 	else
 		p++;
Index: sbin/disklabel/disklabel.c
===================================================================
RCS file: /cvs/src/sbin/disklabel/disklabel.c,v
retrieving revision 1.5
diff -u -r1.5 disklabel.c
--- sbin/disklabel/disklabel.c	4 Mar 2004 01:38:01 -0000	1.5
+++ sbin/disklabel/disklabel.c	30 Aug 2004 18:18:39 -0000
@@ -598,7 +598,7 @@
 	 */
 	if (!xxboot || !bootxx) {
 		dkbasename = np;
-		if ((p = rindex(dkname, '/')) == NULL)
+		if ((p = strrchr(dkname, '/')) == NULL)
 			p = dkname;
 		else
 			p++;
@@ -948,12 +948,12 @@
 	lp->d_sbsize = SBSIZE;				/* XXX */
 	while (fgets(line, sizeof(line) - 1, f)) {
 		lineno++;
-		if ((cp = index(line,'\n')) != 0)
+		if ((cp = strchr(line,'\n')) != 0)
 			*cp = '\0';
 		cp = skip(line);
 		if (cp == NULL)
 			continue;
-		tp = index(cp, ':');
+		tp = strchr(cp, ':');
 		if (tp == NULL) {
 			fprintf(stderr, "line %d: syntax error\n", lineno);
 			errors++;
Index: sbin/dump/main.c
===================================================================
RCS file: /cvs/src/sbin/dump/main.c,v
retrieving revision 1.6
diff -u -r1.6 main.c
--- sbin/dump/main.c	4 Feb 2004 17:39:59 -0000	1.6
+++ sbin/dump/main.c	30 Aug 2004 18:18:39 -0000
@@ -259,7 +259,7 @@
 		tape = strchr(host, ':');
 		*tape++ = '\0';
 #ifdef RDUMP
-		if (index(tape, '\n')) {
+		if (strchr(tape, '\n')) {
 		    (void)fprintf(stderr, "invalid characters in tape\n");
 		    exit(X_STARTUP);
 		}
Index: sbin/quotacheck/quotacheck.c
===================================================================
RCS file: /cvs/src/sbin/quotacheck/quotacheck.c,v
retrieving revision 1.5
diff -u -r1.5 quotacheck.c
--- sbin/quotacheck/quotacheck.c	1 Nov 2003 17:16:01 -0000	1.5
+++ sbin/quotacheck/quotacheck.c	30 Aug 2004 18:18:40 -0000
@@ -436,7 +436,7 @@
 	}
 	strcpy(buf, fs->fs_mntops);
 	for (opt = strtok(buf, ","); opt; opt = strtok(NULL, ",")) {
-		if ((cp = index(opt, '=')) != NULL)
+		if ((cp = strchr(opt, '=')) != NULL)
 			*cp++ = '\0';
 		if (type == USRQUOTA && strcmp(opt, usrname) == 0)
 			break;
Index: sbin/reboot/reboot.c
===================================================================
RCS file: /cvs/src/sbin/reboot/reboot.c,v
retrieving revision 1.3
diff -u -r1.3 reboot.c
--- sbin/reboot/reboot.c	28 Sep 2003 14:39:21 -0000	1.3
+++ sbin/reboot/reboot.c	30 Aug 2004 18:18:40 -0000
@@ -65,7 +65,7 @@
 	char *kernel, *p;
 	const char *user;
 
-	if (strstr((p = rindex(*argv, '/')) ? p + 1 : *argv, "halt")) {
+	if (strstr((p = strrchr(*argv, '/')) ? p + 1 : *argv, "halt")) {
 		dohalt = 1;
 		howto = RB_HALT;
 	} else
Index: usr.sbin/chown/chown.c
===================================================================
RCS file: /cvs/src/usr.sbin/chown/chown.c,v
retrieving revision 1.4
diff -u -r1.4 chown.c
--- usr.sbin/chown/chown.c	15 Nov 2003 23:33:35 -0000	1.4
+++ usr.sbin/chown/chown.c	30 Aug 2004 18:25:22 -0000
@@ -70,7 +70,7 @@
 	int Hflag, Lflag, Pflag, ch, fts_options, hflag, rval;
 	char *cp;
 
-	myname = (cp = rindex(*argv, '/')) ? cp + 1 : *argv;
+	myname = (cp = strrchr(*argv, '/')) ? cp + 1 : *argv;
 	ischown = myname[2] == 'o';
 
 	Hflag = Lflag = Pflag = hflag = vflag = 0;
Index: usr.sbin/config/mkmakefile.c
===================================================================
RCS file: /cvs/src/usr.sbin/config/mkmakefile.c,v
retrieving revision 1.11
diff -u -r1.11 mkmakefile.c
--- usr.sbin/config/mkmakefile.c	8 Mar 2004 06:13:17 -0000	1.11
+++ usr.sbin/config/mkmakefile.c	30 Aug 2004 18:25:22 -0000
@@ -659,7 +659,7 @@
 {
 	char *cp;
 
-	cp = rindex(fn, '/');
+	cp = strrchr(fn, '/');
 	if (cp == 0)
 		return(fn);
 	return(cp + 1);
Index: usr.sbin/diskpart/diskpart.c
===================================================================
RCS file: /cvs/src/usr.sbin/diskpart/diskpart.c,v
retrieving revision 1.5
diff -u -r1.5 diskpart.c
--- usr.sbin/diskpart/diskpart.c	20 Mar 2004 17:46:47 -0000	1.5
+++ usr.sbin/diskpart/diskpart.c	30 Aug 2004 18:25:23 -0000
@@ -399,7 +399,7 @@
 		fprintf(stderr, "%s: unrecognized controller type\n", buf);
 		fprintf(stderr, "use one of:\n");
 		for (tp = dktypenames; *tp; tp++)
-			if (index(*tp, ' ') == 0)
+			if (strchr(*tp, ' ') == 0)
 				fprintf(stderr, "\t%s\n", *tp);
 	}
 gettype:
Index: usr.sbin/edquota/edquota.c
===================================================================
RCS file: /cvs/src/usr.sbin/edquota/edquota.c,v
retrieving revision 1.6
diff -u -r1.6 edquota.c
--- usr.sbin/edquota/edquota.c	15 Mar 2004 18:10:26 -0000	1.6
+++ usr.sbin/edquota/edquota.c	30 Aug 2004 18:25:23 -0000
@@ -792,7 +792,7 @@
 	}
 	strcpy(buf, fs->fs_mntops);
 	for (opt = strtok(buf, ","); opt; opt = strtok(NULL, ",")) {
-		if ((cp = index(opt, '=')))
+		if ((cp = strchr(opt, '=')))
 			*cp++ = '\0';
 		if (type == USRQUOTA && strcmp(opt, usrname) == 0)
 			break;
Index: usr.sbin/inetd/inetd.c
===================================================================
RCS file: /cvs/src/usr.sbin/inetd/inetd.c,v
retrieving revision 1.5
diff -u -r1.5 inetd.c
--- usr.sbin/inetd/inetd.c	20 Mar 2004 17:46:48 -0000	1.5
+++ usr.sbin/inetd/inetd.c	30 Aug 2004 18:25:23 -0000
@@ -1684,7 +1684,7 @@
 			sep->se_rpc_lowvers = 0;
 		memcpy(&sep->se_ctrladdr4, bind_sa4,
 		       sizeof(sep->se_ctrladdr4));
-                if ((versp = rindex(sep->se_service, '/'))) {
+                if ((versp = strrchr(sep->se_service, '/'))) {
                         *versp++ = '\0';
                         switch (sscanf(versp, "%u-%u",
                                        &sep->se_rpc_lowvers,
@@ -1851,7 +1851,7 @@
 	} else
 		sep->se_group = NULL;
 	sep->se_server = newstr(sskip(&cp));
-	if ((sep->se_server_name = rindex(sep->se_server, '/')))
+	if ((sep->se_server_name = strrchr(sep->se_server, '/')))
 		sep->se_server_name++;
 	if (strcmp(sep->se_server, "internal") == 0) {
 		struct biltin *bi;
Index: usr.sbin/mtree/spec.c
===================================================================
RCS file: /cvs/src/usr.sbin/mtree/spec.c,v
retrieving revision 1.5
diff -u -r1.5 spec.c
--- usr.sbin/mtree/spec.c	15 Mar 2004 16:24:22 -0000	1.5
+++ usr.sbin/mtree/spec.c	30 Aug 2004 18:25:24 -0000
@@ -73,7 +73,7 @@
 			continue;
 
 		/* Find end of line. */
-		if ((p = index(buf, '\n')) == NULL)
+		if ((p = strchr(buf, '\n')) == NULL)
 			errx(1, "line %d too long", lineno);
 
 		/* See if next line is continuation line. */
@@ -118,7 +118,7 @@
 				continue;
 			}
 
-		if (index(p, '/'))
+		if (strchr(p, '/'))
 			errx(1, "line %d: slash character in file name",
 			lineno);
 
Index: usr.sbin/newsyslog/newsyslog.c
===================================================================
RCS file: /cvs/src/usr.sbin/newsyslog/newsyslog.c,v
retrieving revision 1.2
diff -u -r1.2 newsyslog.c
--- usr.sbin/newsyslog/newsyslog.c	17 Jun 2003 04:29:57 -0000	1.2
+++ usr.sbin/newsyslog/newsyslog.c	30 Aug 2004 18:25:24 -0000
@@ -1186,7 +1186,7 @@
 		} else {	/* relative */
 			/* get directory part of logfile */
 			strlcpy(dirpart, log, sizeof(dirpart));
-			if ((p = rindex(dirpart, '/')) == NULL)
+			if ((p = strrchr(dirpart, '/')) == NULL)
 				dirpart[0] = '\0';
 			else
 				*(p + 1) = '\0';
@@ -1198,7 +1198,7 @@
 			createdir(ent, dirpart);
 
 		/* get filename part of logfile */
-		if ((p = rindex(log, '/')) == NULL)
+		if ((p = strrchr(log, '/')) == NULL)
 			strlcpy(namepart, log, sizeof(namepart));
 		else
 			strlcpy(namepart, p + 1, sizeof(namepart));
@@ -1480,7 +1480,7 @@
 		} else {	/* relative */
 			/* get directory part of logfile */
 			strlcpy(tmp, file, sizeof(tmp));
-			if ((p = rindex(tmp, '/')) == NULL)
+			if ((p = strrchr(tmp, '/')) == NULL)
 				tmp[0] = '\0';
 			else
 				*(p + 1) = '\0';
@@ -1490,7 +1490,7 @@
 		strlcat(tmp, "/", sizeof(tmp));
 
 		/* get filename part of logfile */
-		if ((p = rindex(file, '/')) == NULL)
+		if ((p = strrchr(file, '/')) == NULL)
 			strlcat(tmp, file, sizeof(tmp));
 		else
 			strlcat(tmp, p + 1, sizeof(tmp));
Index: usr.sbin/quotaon/quotaon.c
===================================================================
RCS file: /cvs/src/usr.sbin/quotaon/quotaon.c,v
retrieving revision 1.5
diff -u -r1.5 quotaon.c
--- usr.sbin/quotaon/quotaon.c	21 Mar 2004 22:41:24 -0000	1.5
+++ usr.sbin/quotaon/quotaon.c	30 Aug 2004 18:25:25 -0000
@@ -75,7 +75,7 @@
 	long argnum, done = 0;
 	int i, offmode = 0, errs = 0;
 
-	whoami = rindex(*argv, '/') + 1;
+	whoami = strrchr(*argv, '/') + 1;
 	if (whoami == (char *)1)
 		whoami = *argv;
 	if (strcmp(whoami, "quotaoff") == 0)
@@ -204,7 +204,7 @@
 	}
 	strcpy(buf, fs->fs_mntops);
 	for (opt = strtok(buf, ","); opt; opt = strtok(NULL, ",")) {
-		if ((cp = index(opt, '=')))
+		if ((cp = strchr(opt, '=')))
 			*cp++ = '\0';
 		if (type == USRQUOTA && strcmp(opt, usrname) == 0)
 			break;
Index: usr.sbin/repquota/repquota.c
===================================================================
RCS file: /cvs/src/usr.sbin/repquota/repquota.c,v
retrieving revision 1.5
diff -u -r1.5 repquota.c
--- usr.sbin/repquota/repquota.c	21 Mar 2004 22:41:24 -0000	1.5
+++ usr.sbin/repquota/repquota.c	30 Aug 2004 18:25:26 -0000
@@ -287,7 +287,7 @@
 	}
 	strcpy(buf, fs->fs_mntops);
 	for (opt = strtok(buf, ","); opt; opt = strtok(NULL, ",")) {
-		if ((cp = index(opt, '=')))
+		if ((cp = strchr(opt, '=')))
 			*cp++ = '\0';
 		if (type == USRQUOTA && strcmp(opt, usrname) == 0)
 			break;
Index: usr.sbin/route6d/route6d.c
===================================================================
RCS file: /cvs/src/usr.sbin/route6d/route6d.c,v
retrieving revision 1.5
diff -u -r1.5 route6d.c
--- usr.sbin/route6d/route6d.c	10 Feb 2004 02:59:43 -0000	1.5
+++ usr.sbin/route6d/route6d.c	30 Aug 2004 18:32:31 -0000
@@ -3006,11 +3006,11 @@
 			iflp = ap;
 			goto ifonly;
 		}
-		if ((p = index(ap, ',')) != NULL) {
+		if ((p = strchr(ap, ',')) != NULL) {
 			*p++ = '\0';
 			iflp = p;
 		}
-		if ((p = index(ap, '/')) == NULL) {
+		if ((p = strchr(ap, '/')) == NULL) {
 			fatal("no prefixlen specified for '%s'", ap);
 			/*NOTREACHED*/
 		}
@@ -3031,7 +3031,7 @@
 		/* parse the interface listing portion */
 		while (iflp) {
 			ifname = iflp;
-			if ((iflp = index(iflp, ',')) != NULL)
+			if ((iflp = strchr(iflp, ',')) != NULL)
 				*iflp++ = '\0';
 			ifcp = ifc_find(ifname);
 			if (ifcp == NULL) {
Index: usr.sbin/rtprio/rtprio.c
===================================================================
RCS file: /cvs/src/usr.sbin/rtprio/rtprio.c,v
retrieving revision 1.2
diff -u -r1.2 rtprio.c
--- usr.sbin/rtprio/rtprio.c	17 Jun 2003 04:30:03 -0000	1.2
+++ usr.sbin/rtprio/rtprio.c	30 Aug 2004 18:25:26 -0000
@@ -58,7 +58,7 @@
 	struct rtprio rtp;
 
 	/* find basename */
-	if ((p = rindex(argv[0], '/')) == NULL)
+	if ((p = strrchr(argv[0], '/')) == NULL)
 		p = argv[0];
 	else
 		++p;
Index: usr.sbin/rwhod/rwhod.c
===================================================================
RCS file: /cvs/src/usr.sbin/rwhod/rwhod.c,v
retrieving revision 1.4
diff -u -r1.4 rwhod.c
--- usr.sbin/rwhod/rwhod.c	13 Mar 2004 21:07:24 -0000	1.4
+++ usr.sbin/rwhod/rwhod.c	30 Aug 2004 18:25:26 -0000
@@ -220,7 +220,7 @@
 		syslog(LOG_ERR, "gethostname: %m");
 		exit(1);
 	}
-	if ((cp = index(myname, '.')) != NULL)
+	if ((cp = strchr(myname, '.')) != NULL)
 		*cp = '\0';
 	strncpy(mywd.wd_hostname, myname, sizeof(mywd.wd_hostname) - 1);
 	mywd.wd_hostname[sizeof(mywd.wd_hostname) - 1] = '\0';
Index: usr.sbin/traceroute6/traceroute6.c
===================================================================
RCS file: /cvs/src/usr.sbin/traceroute6/traceroute6.c,v
retrieving revision 1.4
diff -u -r1.4 traceroute6.c
--- usr.sbin/traceroute6/traceroute6.c	30 Mar 2004 01:14:22 -0000	1.4
+++ usr.sbin/traceroute6/traceroute6.c	30 Aug 2004 18:25:27 -0000
@@ -1295,7 +1295,7 @@
 	if (first && !nflag) {
 		first = 0;
 		if (gethostname(domain, MAXHOSTNAMELEN) == 0 &&
-		    (cp = index(domain, '.')))
+		    (cp = strchr(domain, '.')))
 			(void) strlcpy(domain, cp + 1, sizeof(domain));
 		else
 			domain[0] = 0;
@@ -1304,7 +1304,7 @@
 	if (!nflag) {
 		if (getnameinfo(sa, sa->sa_len, line, sizeof(line), NULL, 0,
 		    NI_NAMEREQD) == 0) {
-			if ((cp = index(line, '.')) &&
+			if ((cp = strchr(line, '.')) &&
 			    !strcmp(cp + 1, domain))
 				*cp = 0;
 			cp = line;
Index: usr.sbin/vnconfig/vnconfig.c
===================================================================
RCS file: /cvs/src/usr.sbin/vnconfig/vnconfig.c,v
retrieving revision 1.7
diff -u -r1.7 vnconfig.c
--- usr.sbin/vnconfig/vnconfig.c	20 Jul 2004 03:35:27 -0000	1.7
+++ usr.sbin/vnconfig/vnconfig.c	30 Aug 2004 18:25:27 -0000
@@ -583,7 +583,7 @@
 	rawbuf = malloc(len + 2);
 	strcpy(rawbuf, dev);
 	if (stat(rawbuf, &sb) != 0 || !S_ISCHR(sb.st_mode)) {
-		dp = rindex(rawbuf, '/');
+		dp = strrchr(rawbuf, '/');
 		if (dp) {
 			for (ep = &rawbuf[len]; ep > dp; --ep)
 				*(ep+1) = *ep;
