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/hotspots.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/hotspots.cpp')
-rw-r--r-- | engines/gob/hotspots.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/engines/gob/hotspots.cpp b/engines/gob/hotspots.cpp index dad141a254..a8972f06ac 100644 --- a/engines/gob/hotspots.cpp +++ b/engines/gob/hotspots.cpp @@ -23,6 +23,8 @@ * */ +#include "common/str.h" + #include "gob/hotspots.h" #include "gob/global.h" #include "gob/helper.h" @@ -880,10 +882,10 @@ uint16 Hotspots::updateInput(uint16 xPos, uint16 yPos, uint16 width, uint16 heig while (1) { // If we the edit field has enough space, add a space for the new character - strncpy0(tempStr, str, 254); + Common::strlcpy(tempStr, str, 255); strcat(tempStr, " "); if ((editSize != 0) && strlen(tempStr) > editSize) - strncpy0(tempStr, str, 255); + Common::strlcpy(tempStr, str, 256); // Clear input area fillRect(xPos, yPos, @@ -2006,14 +2008,14 @@ void Hotspots::checkStringMatch(const Hotspot &spot, const InputDesc &input, char tempStr[256]; char spotStr[256]; - strncpy0(tempStr, GET_VARO_STR(spot.key), 255); + Common::strlcpy(tempStr, GET_VARO_STR(spot.key), 256); if (spot.getType() < kTypeInput3NoLeave) _vm->_util->cleanupStr(tempStr); uint16 pos = 0; do { - strncpy0(spotStr, str, 255); + Common::strlcpy(spotStr, str, 256); pos += strlen(str) + 1; str += strlen(str) + 1; @@ -2140,7 +2142,7 @@ void Hotspots::updateAllTexts(const InputDesc *inputs) const { // Get its text char tempStr[256]; - strncpy0(tempStr, GET_VARO_STR(spot.key), 255); + Common::strlcpy(tempStr, GET_VARO_STR(spot.key), 256); // Coordinates uint16 x = spot.left; |