Fix segfault when binding keys in-game

This commit is contained in:
Pasi Kallinen
2026-04-06 11:50:18 +03:00
parent 0a3b8a7b72
commit 190cbfa2b7

View File

@@ -2297,7 +2297,6 @@ handler_rebind_keys_add(boolean keyfirst)
char buf2[QBUFSZ];
uchar key = '\0';
int clr = NO_COLOR;
struct Cmd_bind *bind;
if (keyfirst) {
pline("Bind which key? ");
@@ -2312,8 +2311,9 @@ handler_rebind_keys_add(boolean keyfirst)
any = cg.zeroany;
if (key) {
bind = cmdbind_get(key);
if (bind) {
struct Cmd_bind *bind = cmdbind_get(key);
if (bind && bind->cmd) {
Sprintf(buf, "Key '%s' is currently bound to \"%s\".",
key2txt(key, buf2), bind->cmd->ef_txt);
} else {