From 5c48c3fd2b5a229e125455b3f5c23f4773b0191e Mon Sep 17 00:00:00 2001 From: Sven Hesse Date: Fri, 15 Oct 2010 13:54:23 +0000 Subject: GOB: Remove strncpy0() Replacing it (and some strncpy + manual terminating) with Common::strlcpy() svn-id: r53490 --- engines/gob/game.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'engines/gob/game.cpp') 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) { -- cgit v1.2.3