And now for my own personal take on COM_CEcho_f

Actually works, is properly centered, allows 1023 characters instead of 1022!
This commit is contained in:
GenericHeroGuy 2026-04-05 20:53:20 +02:00
parent 3d43d01ca6
commit bc465faada

View file

@ -810,12 +810,14 @@ static void COM_Echo_f(void)
static void COM_CEcho_f(void)
{
size_t i;
char cechotext[1024] = "";
char cechotext[1024];
for (i = 1; i < COM_Argc(); i++)
strlcpy(cechotext, COM_Argc() > 1 ? COM_Argv(1) : "", sizeof(cechotext));
for (i = 2; i < COM_Argc(); i++)
{
strlcpy(cechotext, COM_Argv(i), sizeof(cechotext)-1);
strlcpy(cechotext, " ", sizeof(cechotext)-1);
strlcat(cechotext, " ", sizeof(cechotext));
strlcat(cechotext, COM_Argv(i), sizeof(cechotext));
}
HU_DoCEcho(cechotext);