From: <ave...@us...> - 2009-05-27 22:31:38
|
Revision: 6133 http://gemrb.svn.sourceforge.net/gemrb/?rev=6133&view=rev Author: avenger_teambg Date: 2009-05-27 22:31:25 +0000 (Wed, 27 May 2009) Log Message: ----------- don't go past the 0 in line Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/GameScript.cpp Modified: gemrb/trunk/gemrb/plugins/Core/GameScript.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/GameScript.cpp 2009-05-27 21:45:04 UTC (rev 6132) +++ gemrb/trunk/gemrb/plugins/Core/GameScript.cpp 2009-05-27 22:31:25 UTC (rev 6133) @@ -1470,19 +1470,21 @@ src++; } *tmp = 0; - src++; + if (*src) + src++; return atoi( number ); } static void ParseString(const char*& src, char* tmp) { - while (*src != '"') { + while (*src != '"' && *src) { *tmp = *src; tmp++; src++; } *tmp = 0; - src++; + if (*src) + src++; } static Object* DecodeObject(const char* line) @@ -1502,13 +1504,16 @@ for (i = 0; i < 4; i++) { oB->objectRect[i] = ParseInt( line ); } - line++; //Skip ] (not really... it skips a ' ' since the ] was skipped by the ParseInt function + if (*line) + line++; //Skip ] (not really... it skips a ' ' since the ] was skipped by the ParseInt function } - line++; //Skip " + if (*line) + line++; //Skip " ParseString( line, oB->objectName ); - line++; //Skip " (the same as above) + if (*line) + line++; //Skip " (the same as above) //this seems to be needed too - if (ExtraParametersCount) { + if (ExtraParametersCount && *line) { line++; } for (i = 0; i < ExtraParametersCount; i++) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |