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/inter_v1.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'engines/gob/inter_v1.cpp') diff --git a/engines/gob/inter_v1.cpp b/engines/gob/inter_v1.cpp index 3bf7fc8fd4..1fe44758df 100644 --- a/engines/gob/inter_v1.cpp +++ b/engines/gob/inter_v1.cpp @@ -24,6 +24,7 @@ */ #include "common/endian.h" +#include "common/str.h" #include "common/file.h" #include "gob/gob.h" @@ -971,7 +972,7 @@ bool Inter_v1::o1_loadTot(OpFuncParams ¶ms) { if ((_vm->_game->_script->peekByte() & 0x80) != 0) { _vm->_game->_script->skip(1); _vm->_game->_script->evalExpr(0); - strncpy0(buf, _vm->_game->_script->getResultStr(), 15); + Common::strlcpy(buf, _vm->_game->_script->getResultStr(), 16); } else { size = _vm->_game->_script->readInt8(); memcpy(buf, _vm->_game->_script->readString(size), size); @@ -1512,7 +1513,7 @@ bool Inter_v1::o1_strToLong(OpFuncParams ¶ms) { int32 res; strVar = _vm->_game->_script->readVarIndex(); - strncpy0(str, GET_VARO_STR(strVar), 19); + Common::strlcpy(str, GET_VARO_STR(strVar), 20); res = atoi(str); destVar = _vm->_game->_script->readVarIndex(); -- cgit v1.2.3