command.c: fix "alias" command crashing when no aliases were registered

if we dont have aliases list how do we check the next alias in the list aswell?
This commit is contained in:
Alug committed 2025-12-07 21:08:38 +01:00
1 parent a2feaa7fde
commit c19c80d797
1 file changed
+2 -2
+2 -2
View File
@@ -652,7 +652,7 @@ static void COM_Alias_f(void)
CONS_Printf(M_GetText("All aliases that start with \x87'%s'\x80 are:\n"), begin);
int count = 0;
for (cmdalias_t *head = com_alias; head->next != NULL; head = head->next)
for (cmdalias_t *head = com_alias; head != NULL; head = head->next)
{
if (strncmp(begin, head->name, szBegin) == 0)
{
@@ -673,7 +673,7 @@ static void COM_Alias_f(void)
/* Display alias subtext, show all aliases. */
CONS_Printf(M_GetText("alias <name> <command>: create a shortcut command that executes other command(s)\n"));
for (cmdalias_t *head = com_alias; head->next != NULL; head = head->next)
for (cmdalias_t *head = com_alias; head != NULL; head = head->next)
{
CONS_Printf(alias_format, head->name, head->value);
}