cecho command: don't add trailing space

Fixes centering for cechos of only punctuation.
This commit is contained in:
James R 2023-08-27 15:11:12 -07:00
parent 2e748636d7
commit e3da061192

View file

@ -777,10 +777,12 @@ static void COM_CEcho_f(void)
size_t i;
char cechotext[1024] = "";
for (i = 1; i < COM_Argc(); i++)
strncpy(cechotext, COM_Argv(1), sizeof(cechotext)-1);
for (i = 2; i < COM_Argc(); i++)
{
strncat(cechotext, COM_Argv(i), sizeof(cechotext)-1);
strncat(cechotext, " ", sizeof(cechotext)-1);
strncat(cechotext, COM_Argv(i), sizeof(cechotext)-1);
}
cechotext[sizeof(cechotext) - 1] = '\0';