Skip to content

Commit ca5c0d2

Browse files
authored
Merge pull request DeusData#588 from GothUncc/fix/gcc15-strstr-const-qualifier
fix(cli): const-qualify local pointers in codex_hook_strip for gcc 15
2 parents eeca97e + c13a9db commit ca5c0d2

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎src/cli/cli.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1500,11 +1500,11 @@ int cbm_remove_codex_mcp(const char *config_path) {
15001500
* plus a leading newline). Returns a newly-malloc'd string the caller frees, or
15011501
* NULL if no block was present (content is left untouched). */
15021502
static char *codex_hook_strip(const char *content) {
1503-
char *begin = strstr(content, CODEX_HOOK_BEGIN);
1503+
const char *begin = strstr(content, CODEX_HOOK_BEGIN);
15041504
if (!begin) {
15051505
return NULL;
15061506
}
1507-
char *end = strstr(begin, CODEX_HOOK_END);
1507+
const char *end = strstr(begin, CODEX_HOOK_END);
15081508
if (!end) {
15091509
return NULL;
15101510
}
@@ -1513,7 +1513,7 @@ static char *codex_hook_strip(const char *content) {
15131513
end++;
15141514
}
15151515
/* Drop one leading newline before the block, if any. */
1516-
char *cut = begin;
1516+
const char *cut = begin;
15171517
if (cut > content && *(cut - CLI_SKIP_ONE) == '\n') {
15181518
cut--;
15191519
}

0 commit comments

Comments
 (0)