From 71163ea888ea6c4d0bea351b554b17941b39e66a Mon Sep 17 00:00:00 2001 From: mortyzip <338174153+mortyzip@users.noreply.github.com> Date: Fri, 9 Oct 2026 01:01:37 +0000 Subject: [PATCH] Fix PS4 build: libPS4 strstr takes non-const pointers --- src/web.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/web.h b/src/web.h index a0a1355..9956a70 100644 --- a/src/web.h +++ b/src/web.h @@ -98,7 +98,8 @@ ka_cfg_number(const char *buf, const char *key, long long *value) { long long n = 0; int digits = 0; - while((p = strstr(p, key))) { + // libPS4's strstr() takes plain char pointers. + while((p = strstr((char*)p, (char*)key))) { if((p == buf || p[-1] == '\n') && p[k] == '=') { for(p += k + 1; *p >= '0' && *p <= '9'; p++) { if(++digits > 9) { @@ -596,7 +597,7 @@ web_header(const char *req, const char *name, char *out, size_t size) { const char *p = req; size_t i; - while((p = strstr(p, "\r\n"))) { + while((p = strstr((char*)p, (char*)"\r\n"))) { p += 2; if(web_header_is(p, name)) { for(p += strlen(name) + 1; *p == ' '; p++);