aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorJohannes Schickel2008-04-03 21:42:04 +0000
committerJohannes Schickel2008-04-03 21:42:04 +0000
commit10233af59f0ff5ccede5afb04fe7379a09346294 (patch)
tree5eed9849ac2ff69e26f3be7084f8fe7aa84922a6 /engines
parent057fb0e9abc8a679ba4d8871dba13a593e0315c4 (diff)
downloadscummvm-rg350-10233af59f0ff5ccede5afb04fe7379a09346294.tar.gz
scummvm-rg350-10233af59f0ff5ccede5afb04fe7379a09346294.tar.bz2
scummvm-rg350-10233af59f0ff5ccede5afb04fe7379a09346294.zip
Cleanup.
-This line, and those below, will be ignored-- M kyra/resource.cpp svn-id: r31370
Diffstat (limited to 'engines')
-rw-r--r--engines/kyra/resource.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/engines/kyra/resource.cpp b/engines/kyra/resource.cpp
index 1cda1c0c95..2aaa49f6d4 100644
--- a/engines/kyra/resource.cpp
+++ b/engines/kyra/resource.cpp
@@ -204,8 +204,9 @@ bool Resource::loadFileList(const Common::String &filedata) {
uint32 offset = f.pos();
f.seek(filenameOffset, SEEK_SET);
- uint8 buffer[64];
- f.read(buffer, sizeof(buffer));
+ uint8 buffer[13];
+ f.read(buffer, sizeof(buffer)-1);
+ buffer[12] = 0;
f.seek(offset + 16, SEEK_SET);
Common::String filename = (char*)buffer;
@@ -467,14 +468,16 @@ bool ResLoaderPak::isLoadable(const Common::String &filename, Common::SeekableRe
offset = SWAP_BYTES_32(offset);
}
+ Common::String file = "";
while (!stream.eos()) {
// The start offset of a file should never be in the filelist
if (offset < stream.pos() || offset > filesize)
return false;
- Common::String file = "";
byte c = 0;
+ file = "";
+
while (!stream.eos() && (c = stream.readByte()) != 0)
file += c;
@@ -512,6 +515,7 @@ bool ResLoaderPak::loadFile(const Common::String &filename, Common::SeekableRead
startoffset = SWAP_BYTES_32(startoffset);
}
+ Common::String file = "";
while (!stream.eos()) {
// The start offset of a file should never be in the filelist
if (startoffset < stream.pos() || startoffset > filesize) {
@@ -519,7 +523,7 @@ bool ResLoaderPak::loadFile(const Common::String &filename, Common::SeekableRead
return false;
}
- Common::String file = "";
+ file = "";
byte c = 0;
while (!stream.eos() && (c = stream.readByte()) != 0)