Backport "bind showkeys" osdcmd crash fix from eduke32

This commit is contained in:
nukeykt 2019-09-30 14:47:49 +09:00 committed by Christoph Oelckers
parent ce61c38660
commit 0d2567a808

View file

@ -500,8 +500,8 @@ static int osdcmd_bind(osdcmdptr_t parm)
char buffer[256]; char buffer[256];
if (parm->numparms==1 && !Bstrcasecmp(parm->parms[0],"showkeys")) if (parm->numparms==1 && !Bstrcasecmp(parm->parms[0],"showkeys"))
{ {
for (int i=0; sctokeylut[i].key; i++) for (auto & s : sctokeylut)
OSD_Printf("%s\n",sctokeylut[i].key); OSD_Printf("%s\n", s.key);
for (auto ConsoleButton : ConsoleButtons) for (auto ConsoleButton : ConsoleButtons)
OSD_Printf("%s\n",ConsoleButton); OSD_Printf("%s\n",ConsoleButton);
return OSDCMD_OK; return OSDCMD_OK;