aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorTorbjörn Andersson2008-12-03 21:52:51 +0000
committerTorbjörn Andersson2008-12-03 21:52:51 +0000
commit1edc1789b1af4a3e5aaaa3e44d5e6683585db8db (patch)
treedd1f993b3c4edc0d5b363d4e7ff49acc8941907b /engines
parent8d0ef7a05ddbe90ea5686cd31a5bec63c4ab81ca (diff)
downloadscummvm-rg350-1edc1789b1af4a3e5aaaa3e44d5e6683585db8db.tar.gz
scummvm-rg350-1edc1789b1af4a3e5aaaa3e44d5e6683585db8db.tar.bz2
scummvm-rg350-1edc1789b1af4a3e5aaaa3e44d5e6683585db8db.zip
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. svn-id: r35226
Diffstat (limited to 'engines')
-rw-r--r--engines/sword2/resman.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/engines/sword2/resman.cpp b/engines/sword2/resman.cpp
index a30c6301cc..e7ef62d672 100644
--- a/engines/sword2/resman.cpp
+++ b/engines/sword2/resman.cpp
@@ -113,7 +113,17 @@ bool ResourceManager::init() {
// 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) {