diff options
author | Sven Hesse | 2010-10-15 13:54:23 +0000 |
---|---|---|
committer | Sven Hesse | 2010-10-15 13:54:23 +0000 |
commit | 5c48c3fd2b5a229e125455b3f5c23f4773b0191e (patch) | |
tree | e046dd5ca61d6f7f78eb61dd9f7b9771168e6dc3 /engines/gob/game.cpp | |
parent | 04973e85be84db4ac5a71a7012eb68c8e52af3c4 (diff) | |
download | scummvm-rg350-5c48c3fd2b5a229e125455b3f5c23f4773b0191e.tar.gz scummvm-rg350-5c48c3fd2b5a229e125455b3f5c23f4773b0191e.tar.bz2 scummvm-rg350-5c48c3fd2b5a229e125455b3f5c23f4773b0191e.zip |
GOB: Remove strncpy0()
Replacing it (and some strncpy + manual terminating) with
Common::strlcpy()
svn-id: r53490
Diffstat (limited to 'engines/gob/game.cpp')
-rw-r--r-- | engines/gob/game.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/engines/gob/game.cpp b/engines/gob/game.cpp index bf0dc4147c..02ad8562de 100644 --- a/engines/gob/game.cpp +++ b/engines/gob/game.cpp @@ -24,6 +24,7 @@ */ #include "common/endian.h" +#include "common/str.h" #include "gob/gob.h" #include "gob/game.h" @@ -360,8 +361,7 @@ void Game::playTot(int16 skipPlay) { if (_totToLoad[0] == 0) break; - strncpy(_curTotFile, _totToLoad, 14); - _curTotFile[13] = '\0'; + Common::strlcpy(_curTotFile, _totToLoad, 14); } } else { @@ -375,8 +375,7 @@ void Game::playTot(int16 skipPlay) { _vm->_inter->_terminate = 2; } - strncpy(_curTotFile, savedTotName, 14); - _curTotFile[13] = '\0'; + Common::strlcpy(_curTotFile, savedTotName, 14); _vm->_inter->_nestLevel = oldNestLevel; _vm->_inter->_breakFromLevel = oldBreakFrom; @@ -581,7 +580,7 @@ void Game::totSub(int8 flags, const char *newTotFile) { if (flags & 1) _vm->_inter->_variables = 0; - strncpy0(_curTotFile, newTotFile, 9); + Common::strlcpy(_curTotFile, newTotFile, 10); strcat(_curTotFile, ".TOT"); if (_vm->_inter->_terminate != 0) { |