Paranoia: Add destination buffer size to Engine::errorString to help avoiding buffer overflows.

svn-id: r35072
This commit is contained in:
Johannes Schickel 2008-11-15 03:16:41 +00:00
parent 486523af51
commit 478ee06fb8
5 changed files with 8 additions and 8 deletions

View file

@ -251,8 +251,8 @@ bool Engine::shouldPerformAutoSave(int lastSaveTime) {
return autosavePeriod != 0 && diff > autosavePeriod * 1000;
}
void Engine::errorString(const char *buf1, char *buf2) {
strcpy(buf2, buf1);
void Engine::errorString(const char *buf1, char *buf2, int size) {
strncpy(buf2, buf1, size);
}
void Engine::pauseEngine(bool pause) {