From 918b3aff5e9a012b2cdaae30c6012be1aa9e595b Mon Sep 17 00:00:00 2001 From: glx Date: Tue, 26 Jan 2010 14:04:56 +0000 Subject: (svn r18919) -Fix (r15371): strcasestr() return should not be const --- src/string.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/string.cpp') diff --git a/src/string.cpp b/src/string.cpp index d9e27857d..2bd747535 100644 --- a/src/string.cpp +++ b/src/string.cpp @@ -385,12 +385,12 @@ char *strndup(const char *s, size_t len) #endif /* !_GNU_SOURCE */ #ifdef DEFINE_STRCASESTR -const char *strcasestr(const char *haystack, const char *needle) +char *strcasestr(const char *haystack, const char *needle) { size_t hay_len = strlen(haystack); size_t needle_len = strlen(needle); while (hay_len >= needle_len) { - if (strncasecmp(haystack, needle, needle_len) == 0) return haystack; + if (strncasecmp(haystack, needle, needle_len) == 0) return const_cast(haystack); haystack++; hay_len--; -- cgit v1.2.3-54-g00ecf