aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2011-11-06 20:37:45 +0100
committerStrangerke2011-11-06 20:38:18 +0100
commit36ad5d89c1917843fc2ec1ab05460e6d167443d2 (patch)
treeb04ffb8f9a6c49eb8294e44789822923887c4283
parent38164ba66acc0cad9b19f879cba73006ca687647 (diff)
downloadscummvm-rg350-36ad5d89c1917843fc2ec1ab05460e6d167443d2.tar.gz
scummvm-rg350-36ad5d89c1917843fc2ec1ab05460e6d167443d2.tar.bz2
scummvm-rg350-36ad5d89c1917843fc2ec1ab05460e6d167443d2.zip
HUGO: Take into account wjp's and LordHoto's suggestions
-rw-r--r--engines/hugo/schedule.cpp11
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;
}