Skip to content

Commit

Permalink
HUGO: Take into account wjp's and LordHoto's suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerke committed Nov 6, 2011
1 parent 38164ba commit 36ad5d8
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions engines/hugo/schedule.cpp
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 36ad5d8

Please sign in to comment.