summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2004-12-19 13:27:51 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2004-12-19 13:27:51 +0000
commit5677a1b879782960b3acfbec15a51e9c6d2688ce (patch)
tree9306f22bb36138dfb030620512b8ff74fdb27903
parentc307e658d61eab7b5469e5acdfa26cf37dc43be5 (diff)
use strchr instead of index
-rw-r--r--sbin/pfctl/pfctl_osfp.c8
-rw-r--r--usr.bin/less/lsystem.c2
-rw-r--r--usr.sbin/tcpdump/pfctl_osfp.c8
3 files changed, 9 insertions, 9 deletions
diff --git a/sbin/pfctl/pfctl_osfp.c b/sbin/pfctl/pfctl_osfp.c
index 9276274dce8..46b9306d2f5 100644
--- a/sbin/pfctl/pfctl_osfp.c
+++ b/sbin/pfctl/pfctl_osfp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl_osfp.c,v 1.9 2004/04/09 12:42:06 cedric Exp $ */
+/* $OpenBSD: pfctl_osfp.c,v 1.10 2004/12/19 13:27:50 deraadt Exp $ */
/*
* Copyright (c) 2003 Mike Frantzen <frantzen@openbsd.org>
@@ -348,7 +348,7 @@ pfctl_get_fingerprint(const char *name)
if ((wr_name = strdup(name)) == NULL)
err(1, "malloc");
- if ((ptr = index(wr_name, ' ')) == NULL) {
+ if ((ptr = strchr(wr_name, ' ')) == NULL) {
free(wr_name);
return (PF_OSFP_NOMATCH);
}
@@ -508,9 +508,9 @@ found:
strlcat(buf, " ", len);
strlcat(buf, version_name, len);
if (subtype_name) {
- if (index(version_name, ' '))
+ if (strchr(version_name, ' '))
strlcat(buf, " ", len);
- else if (index(version_name, '.') &&
+ else if (strchr(version_name, '.') &&
isdigit(*subtype_name))
strlcat(buf, ".", len);
else
diff --git a/usr.bin/less/lsystem.c b/usr.bin/less/lsystem.c
index 8fa4683215e..44ec82c58e7 100644
--- a/usr.bin/less/lsystem.c
+++ b/usr.bin/less/lsystem.c
@@ -431,7 +431,7 @@ FILE *popen(name, mode)
while (*cp == ' ')
cp++;
strlcpy(cmd_path, cp, sizeof(cmd_path));
- if (cp = index(cmd_path, ' '))
+ if (cp = strchr(cmd_path, ' '))
*cp++ = '\0';
strlcpy(cmd, "ex ", sizeof(cmd));
strlcat(cmd, cmd_path, sizeof(cmd));
diff --git a/usr.sbin/tcpdump/pfctl_osfp.c b/usr.sbin/tcpdump/pfctl_osfp.c
index 2433c7adc18..c4fb90f5a30 100644
--- a/usr.sbin/tcpdump/pfctl_osfp.c
+++ b/usr.sbin/tcpdump/pfctl_osfp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl_osfp.c,v 1.1 2004/01/28 19:44:55 canacar Exp $ */
+/* $OpenBSD: pfctl_osfp.c,v 1.2 2004/12/19 13:27:25 deraadt Exp $ */
/*
* Copyright (c) 2003 Mike Frantzen <frantzen@openbsd.org>
@@ -341,7 +341,7 @@ pfctl_get_fingerprint(const char *name)
if ((wr_name = strdup(name)) == NULL)
err(1, "malloc");
- if ((ptr = index(wr_name, ' ')) == NULL) {
+ if ((ptr = strchr(wr_name, ' ')) == NULL) {
free(wr_name);
return (PF_OSFP_NOMATCH);
}
@@ -501,9 +501,9 @@ found:
strlcat(buf, " ", len);
strlcat(buf, version_name, len);
if (subtype_name) {
- if (index(version_name, ' '))
+ if (strchr(version_name, ' '))
strlcat(buf, " ", len);
- else if (index(version_name, '.') &&
+ else if (strchr(version_name, '.') &&
isdigit(*subtype_name))
strlcat(buf, ".", len);
else