[Scummvm-cvs-logs] SF.net SVN: scummvm:[53242] scummvm/trunk/engines/sword25/script/ luabindhelper.cpp

sev at users.sourceforge.net sev at users.sourceforge.net
Wed Oct 13 00:45:33 CEST 2010


Revision: 53242
          http://scummvm.svn.sourceforge.net/scummvm/?rev=53242&view=rev
Author:   sev
Date:     2010-10-12 22:45:32 +0000 (Tue, 12 Oct 2010)

Log Message:
-----------
SWORD25: Make Lua package registering more robust.

Modified Paths:
--------------
    scummvm/trunk/engines/sword25/script/luabindhelper.cpp

Modified: scummvm/trunk/engines/sword25/script/luabindhelper.cpp
===================================================================
--- scummvm/trunk/engines/sword25/script/luabindhelper.cpp	2010-10-12 22:45:14 UTC (rev 53241)
+++ scummvm/trunk/engines/sword25/script/luabindhelper.cpp	2010-10-12 22:45:32 UTC (rev 53242)
@@ -325,11 +325,11 @@
 bool BS_LuaBindhelper::_CreateTable(lua_State *L, const Common::String &TableName) {
 	const char *PartBegin = TableName.c_str();
 
-	while (*PartBegin) {
+	while (PartBegin - TableName.c_str() < (int)TableName.size()) {
 		const char *PartEnd = strchr(PartBegin, '.');
 		if (!PartEnd)
 			PartEnd = PartBegin + strlen(PartBegin);
-		Common::String SubTableName(PartBegin, PartEnd - PartBegin);
+		Common::String SubTableName(PartBegin, PartEnd);
 
 		// Tables with an empty string as the name are not allowed
 		if (SubTableName.size() == 0)


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list