From: Karel Zak Date: Thu, 27 Nov 2025 15:38:18 +0000 (+0100) Subject: lsfd: fix const qualifier warning in strnrstr X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=935f2ab21add95059a92208f69ef578708307481;p=thirdparty%2Futil-linux.git lsfd: fix const qualifier warning in strnrstr 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 --- diff --git a/lsfd-cmd/file.c b/lsfd-cmd/file.c index 2857c9410..0df0554f5 100644 --- a/lsfd-cmd/file.c +++ b/lsfd-cmd/file.c @@ -384,7 +384,7 @@ void decode_source(char *buf, size_t bufsize, 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)