[Scummvm-cvs-logs] scummvm master -> 36ad5d89c1917843fc2ec1ab05460e6d167443d2

Strangerke Strangerke at scummvm.org
Sun Nov 6 20:39:31 CET 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
36ad5d89c1 HUGO: Take into account wjp's and LordHoto's suggestions


Commit: 36ad5d89c1917843fc2ec1ab05460e6d167443d2
    https://github.com/scummvm/scummvm/commit/36ad5d89c1917843fc2ec1ab05460e6d167443d2
Author: Strangerke (strangerke at scummvm.org)
Date: 2011-11-06T11:38:18-08:00

Commit Message:
HUGO: Take into account wjp's and LordHoto's suggestions

Changed paths:
    engines/hugo/schedule.cpp



diff --git a/engines/hugo/schedule.cpp b/engines/hugo/schedule.cpp
index 6a4fd88..892c144 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;
 	}
 






More information about the Scummvm-git-logs mailing list