diff options
Diffstat (limited to 'engines/hugo/schedule.cpp')
-rw-r--r-- | engines/hugo/schedule.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/engines/hugo/schedule.cpp b/engines/hugo/schedule.cpp index 6a4fd88354..892c144393 100644 --- a/engines/hugo/schedule.cpp +++ b/engines/hugo/schedule.cpp @@ -1539,9 +1539,7 @@ void Scheduler_v1d::promptAction(act *action) { response.toLowercase(); char resp[256]; - strncpy(resp, response.c_str(), 256); - if (response.size() > 256) - resp[255] = '\0'; + Common::strlcpy(resp, response.c_str(), 256); if (action->a3.encodedFl) decodeString(resp); @@ -1587,14 +1585,9 @@ void Scheduler_v2d::promptAction(act *action) { bool found = false; const char *tmpStr; // General purpose string ptr - char resp[256]; - strncpy(resp, response.c_str(), 256); - if (response.size() > 256) - resp[255] = '\0'; - for (int dx = 0; !found && (action->a3.responsePtr[dx] != -1); dx++) { tmpStr = _vm->_file->fetchString(action->a3.responsePtr[dx]); - if (strstr(Utils::strlwr(resp), tmpStr)) + if (response.contains(tmpStr)) found = true; } |