buf[sizeof(buf)] = 0; is bad. buf[sizeof(buf) - 1] = 0; is good.

This commit is contained in:
Adam Olsen 2001-12-05 09:24:19 +00:00
parent f6ef79b7e3
commit 7c6765df60

View file

@ -848,7 +848,7 @@ Cmd_ExecuteString (const char *text, cmd_source_t src)
char buf2[1024];
strncpy(buf, text, sizeof(buf) - 1);
buf[sizeof(buf)] = 0;
buf[sizeof(buf) - 1] = 0;
Cmd_ParseSpecial (buf);
Cmd_ExpandVariables (buf, buf2);
Cmd_TokenizeString (buf2);