[Scummvm-cvs-logs] SF.net SVN: scummvm:[35226] scummvm/trunk/engines/sword2/resman.cpp
eriktorbjorn at users.sourceforge.net
eriktorbjorn at users.sourceforge.net
Wed Dec 3 22:52:51 CET 2008
Revision: 35226
http://scummvm.svn.sourceforge.net/scummvm/?rev=35226&view=rev
Author: eriktorbjorn
Date: 2008-12-03 21:52:51 +0000 (Wed, 03 Dec 2008)
Log Message:
-----------
Changed readLine_OLD() to readLine_NEW(). I guess both this and the previous
readLine() change could be more robust, but at least it should be no worse than
it was before.
Modified Paths:
--------------
scummvm/trunk/engines/sword2/resman.cpp
Modified: scummvm/trunk/engines/sword2/resman.cpp
===================================================================
--- scummvm/trunk/engines/sword2/resman.cpp 2008-12-03 21:47:31 UTC (rev 35225)
+++ scummvm/trunk/engines/sword2/resman.cpp 2008-12-03 21:52:51 UTC (rev 35226)
@@ -113,7 +113,17 @@
// The resource.inf file is a simple text file containing the names of
// all the resource files.
- while (file.readLine_OLD(_resFiles[_totalClusters].fileName, sizeof(_resFiles[_totalClusters].fileName))) {
+ while (1) {
+ char *buf = _resFiles[_totalClusters].fileName;
+ uint len = sizeof(_resFiles[_totalClusters].fileName);
+
+ if (!file.readLine_NEW(buf, len))
+ break;
+
+ int pos = strlen(buf);
+ if (buf[pos - 1] == 0x0A)
+ buf[pos - 1] = 0;
+
_resFiles[_totalClusters].numEntries = -1;
_resFiles[_totalClusters].entryTab = NULL;
if (++_totalClusters >= MAX_res_files) {
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