diff options
Diffstat (limited to 'newlib/libc/string/strstr.c')
-rw-r--r-- | newlib/libc/string/strstr.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/newlib/libc/string/strstr.c b/newlib/libc/string/strstr.c index 00fe060e9..84e4632f1 100644 --- a/newlib/libc/string/strstr.c +++ b/newlib/libc/string/strstr.c @@ -90,7 +90,7 @@ strstr (const char *hs, const char *ne) # define RETURN_TYPE char * # define AVAILABLE(h, h_l, j, n_l) (((j) <= (h_l) - (n_l)) \ - || ((h_l) += strnlen ((h) + (h_l), (n_l) | 2048), ((j) <= (h_l) - (n_l)))) + || ((h_l) += strnlen ((const char *) (h) + (h_l), (n_l) | 2048), ((j) <= (h_l) - (n_l)))) # include "str-two-way.h" @@ -151,7 +151,7 @@ strstr (const char *haystack, const char *needle) if (ne[0] == '\0') return (char *) hs; if (ne[1] == '\0') - return (char*)strchr (hs, ne[0]); + return (char*)strchr ((const char *) hs, ne[0]); if (ne[2] == '\0') return strstr2 (hs, ne); if (ne[3] == '\0') @@ -159,8 +159,8 @@ strstr (const char *haystack, const char *needle) if (ne[4] == '\0') return strstr4 (hs, ne); - size_t ne_len = strlen (ne); - size_t hs_len = strnlen (hs, ne_len | 512); + size_t ne_len = strlen ((const char *) ne); + size_t hs_len = strnlen ((const char *) hs, ne_len | 512); /* Ensure haystack length is >= needle length. */ if (hs_len < ne_len) @@ -191,7 +191,7 @@ strstr (const char *haystack, const char *needle) } if (end[ne_len] == 0) return NULL; - end += strnlen (end + ne_len, 2048); + end += strnlen ((const char *) (end + ne_len), 2048); } while (hs <= end); |