From 4bcea0ab783c667940008a5cab6910b7a826f08c Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Mon, 19 Apr 2021 18:09:20 +0300 Subject: [PATCH] - handle empty command names when getting key binds See https://github.com/Realm667/WolfenDoom/issues/498 --- src/common/console/c_bind.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/common/console/c_bind.cpp b/src/common/console/c_bind.cpp index fa94d1e72..b390dc122 100644 --- a/src/common/console/c_bind.cpp +++ b/src/common/console/c_bind.cpp @@ -460,6 +460,11 @@ int FKeyBindings::GetKeysForCommand (const char *cmd, int *first, int *second) *first = *second = c = i = 0; + if (cmd[0] == '\0') + { + return 0; + } + while (i < NUM_KEYS && c < 2) { if (stricmp (cmd, Binds[i]) == 0)