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

(this is in net_svc too)
This commit is contained in:
Adam Olsen 2001-12-05 09:25:17 +00:00
parent 6b10cb7c4b
commit 15f7173ddd

View file

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