Fix const qualifier discarded warning in strnrstr().
This warning is reported by gcc 15 which defaults to the C23 standard.
The function returns a non-const pointer into the haystack parameter,
and callers modify the string through that pointer. Therefore, the
haystack parameter should be char * rather than const char *.
Signed-off-by: Karel Zak <kzak@redhat.com>
dev_minor);
}
-static char *strnrstr(const char *haystack, const char *needle, size_t needle_len)
+static char *strnrstr(char *haystack, const char *needle, size_t needle_len)
{
char *last = strstr(haystack, needle);
if (last == NULL)