From 36ad5d89c1917843fc2ec1ab05460e6d167443d2 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sun, 6 Nov 2011 20:37:45 +0100 Subject: HUGO: Take into account wjp's and LordHoto's suggestions --- engines/hugo/schedule.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'engines/hugo') 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; } -- cgit v1.2.3