summaryrefslogtreecommitdiff
path: root/lib/libc/string
diff options
context:
space:
mode:
authorJordan K. Hubbard <jkh@FreeBSD.org>2003-12-17 02:46:48 +0000
committerJordan K. Hubbard <jkh@FreeBSD.org>2003-12-17 02:46:48 +0000
commitdee551158f72e1e1768ca3e076e0b625903d41ba (patch)
tree65cabad01932f2d9252277f1b846fb0e6baa48e7 /lib/libc/string
parentaf7552658b7b6301c4b6cd182a2c0141c429df48 (diff)
Notes
Diffstat (limited to 'lib/libc/string')
-rw-r--r--lib/libc/string/index.c3
-rw-r--r--lib/libc/string/rindex.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/libc/string/index.c b/lib/libc/string/index.c
index c81f95b0989b..fe523be40f86 100644
--- a/lib/libc/string/index.c
+++ b/lib/libc/string/index.c
@@ -52,8 +52,9 @@ index
#endif
(const char *p, int ch)
{
+ char c = ch;
for (;; ++p) {
- if (*p == ch)
+ if (*p == c)
return ((char *)p);
if (*p == '\0')
return (NULL);
diff --git a/lib/libc/string/rindex.c b/lib/libc/string/rindex.c
index d0be32e4549b..9deeb1fb209c 100644
--- a/lib/libc/string/rindex.c
+++ b/lib/libc/string/rindex.c
@@ -53,9 +53,10 @@ rindex
(const char *p, int ch)
{
char *save;
+ char c = ch;
for (save = NULL;; ++p) {
- if (*p == ch)
+ if (*p == c)
save = (char *)p;
if (*p == '\0')
return (save);