diff --git a/libc/string/index.c b/libc/string/index.c index fb0492f8b..81bfba490 100644 --- a/libc/string/index.c +++ b/libc/string/index.c @@ -34,7 +34,7 @@ char * index(const char *p, int ch) { for (;; ++p) { - if (*p == ch) + if (*p == (char) ch) return((char *)p); if (!*p) return((char *)NULL); diff --git a/libc/string/memrchr.c b/libc/string/memrchr.c index a533fefe6..aeb5643b0 100644 --- a/libc/string/memrchr.c +++ b/libc/string/memrchr.c @@ -35,10 +35,10 @@ void *memrchr(const void *s, int c, size_t n) const char* q = p + n; while (1) { - q--; if (q < p || q[0] == c) break; - q--; if (q < p || q[0] == c) break; - q--; if (q < p || q[0] == c) break; - q--; if (q < p || q[0] == c) break; + q--; if (q < p || q[0] == (char) c) break; + q--; if (q < p || q[0] == (char) c) break; + q--; if (q < p || q[0] == (char) c) break; + q--; if (q < p || q[0] == (char) c) break; } if (q >= p) return (void*)q; diff --git a/libc/string/strchr.c b/libc/string/strchr.c index 31ba4e223..9b4332c7e 100644 --- a/libc/string/strchr.c +++ b/libc/string/strchr.c @@ -34,7 +34,7 @@ char * strchr(const char *p, int ch) { for (;; ++p) { - if (*p == ch) + if (*p == (char) ch) return((char *)p); if (!*p) return((char *)NULL); diff --git a/libc/string/strrchr.c b/libc/string/strrchr.c index 4918f82db..10c07e63c 100644 --- a/libc/string/strrchr.c +++ b/libc/string/strrchr.c @@ -36,7 +36,7 @@ strrchr(const char *p, int ch) char *save; for (save = NULL;; ++p) { - if (*p == ch) + if (*p == (char) ch) save = (char *)p; if (!*p) return(save);