diff --git a/source4/lib/replace/replace.c b/source4/lib/replace/replace.c index 7bfdc3d6407..17a04c62396 100644 --- a/source4/lib/replace/replace.c +++ b/source4/lib/replace/replace.c @@ -506,7 +506,7 @@ char *rep_strcasestr(const char *haystack, const char *needle) for (s=haystack;*s;s++) { if (toupper(*needle) == toupper(*s) && strncasecmp(s, needle, nlen) == 0) { - return discard_const_p(char, s); + return (char *)((intptr_t)s); } } return NULL;