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/inter_v2.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/inter_v2.cpp')
-rw-r--r-- | engines/gob/inter_v2.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/engines/gob/inter_v2.cpp b/engines/gob/inter_v2.cpp index 0003332e47..de20cfae56 100644 --- a/engines/gob/inter_v2.cpp +++ b/engines/gob/inter_v2.cpp @@ -24,6 +24,7 @@ */ #include "common/endian.h" +#include "common/str.h" #include "gui/message.h" @@ -530,7 +531,7 @@ void Inter_v2::o2_readLIC() { char path[40]; _vm->_game->_script->evalExpr(0); - strncpy0(path, _vm->_game->_script->getResultStr(), 35); + Common::strlcpy(path, _vm->_game->_script->getResultStr(), 36); strcat(path, ".LIC"); _vm->_sound->cdLoadLIC(path); @@ -963,7 +964,7 @@ void Inter_v2::o2_playImd() { _vm->_game->_script->evalExpr(0); _vm->_game->_script->getResultStr()[8] = 0; - strncpy0(imd, _vm->_game->_script->getResultStr(), 127); + Common::strlcpy(imd, _vm->_game->_script->getResultStr(), 128); VideoPlayer::Properties props; @@ -1031,7 +1032,7 @@ void Inter_v2::o2_openItk() { char fileName[32]; _vm->_game->_script->evalExpr(0); - strncpy0(fileName, _vm->_game->_script->getResultStr(), 27); + Common::strlcpy(fileName, _vm->_game->_script->getResultStr(), 28); if (!strchr(fileName, '.')) strcat(fileName, ".ITK"); @@ -1462,7 +1463,7 @@ void Inter_v2::o2_loadInfogramesIns(OpGobParams ¶ms) { varName = _vm->_game->_script->readInt16(); - strncpy0(fileName, GET_VAR_STR(varName), 15); + Common::strlcpy(fileName, GET_VAR_STR(varName), 16); strcat(fileName, ".INS"); _vm->_sound->infogramesLoadInstruments(fileName); @@ -1474,7 +1475,7 @@ void Inter_v2::o2_playInfogrames(OpGobParams ¶ms) { varName = _vm->_game->_script->readInt16(); - strncpy0(fileName, GET_VAR_STR(varName), 15); + Common::strlcpy(fileName, GET_VAR_STR(varName), 16); strcat(fileName, ".DUM"); _vm->_sound->infogramesLoadSong(fileName); @@ -1560,7 +1561,7 @@ int16 Inter_v2::loadSound(int16 search) { if (id == -1) { char sndfile[14]; - strncpy0(sndfile, _vm->_game->_script->readString(9), 9); + Common::strlcpy(sndfile, _vm->_game->_script->readString(9), 10); if (type == SOUND_ADL) strcat(sndfile, ".ADL"); |