mirror of
https://github.com/git-for-windows/git.git
synced 2026-04-09 23:33:34 -05:00
transport-helper: drop const to fix strchr() warnings
We implicitly drop the const from our "key" variable when we do: char *p = strchr(key, ' '); which causes compilation with some C23 versions of libc (notably recent glibc) to complain. We need "p" to remain writable, since we assign NUL over the space we found. We can solve this by also making "key" writable. This works because it comes from a strbuf, which is itself a writable string. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
2fb6a18782
commit
eedc7ecc66
@@ -781,7 +781,8 @@ static int push_update_ref_status(struct strbuf *buf,
|
||||
|
||||
if (starts_with(buf->buf, "option ")) {
|
||||
struct object_id old_oid, new_oid;
|
||||
const char *key, *val;
|
||||
char *key;
|
||||
const char *val;
|
||||
char *p;
|
||||
|
||||
if (!state->hint || !(state->report || state->new_report))
|
||||
|
||||
Reference in New Issue
Block a user