aboutsummaryrefslogtreecommitdiff
path: root/engines/hopkins/files.cpp
diff options
context:
space:
mode:
authoruruk2014-05-30 11:14:47 +0200
committeruruk2014-05-30 11:14:47 +0200
commitbb2f8dd68e1d6b2b30b07f60c0cd4e125b47ea4d (patch)
tree9a1e28cfb1eb1a322225c05adc0962a2f96ea521 /engines/hopkins/files.cpp
parent5ad4e157e5398347651a0da0db07f9daf01bf373 (diff)
parent0a46d67baea121bed0511ce45bfdd8438a43d35d (diff)
downloadscummvm-rg350-bb2f8dd68e1d6b2b30b07f60c0cd4e125b47ea4d.tar.gz
scummvm-rg350-bb2f8dd68e1d6b2b30b07f60c0cd4e125b47ea4d.tar.bz2
scummvm-rg350-bb2f8dd68e1d6b2b30b07f60c0cd4e125b47ea4d.zip
Merge branch 'master' of https://github.com/scummvm/scummvm into cge2
Diffstat (limited to 'engines/hopkins/files.cpp')
-rw-r--r--engines/hopkins/files.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/engines/hopkins/files.cpp b/engines/hopkins/files.cpp
index 75f429f860..6620f2878c 100644
--- a/engines/hopkins/files.cpp
+++ b/engines/hopkins/files.cpp
@@ -51,12 +51,13 @@ byte *FileManager::loadFile(const Common::String &file) {
// Allocate space for the file contents
size_t filesize = f.size();
- byte *data = _vm->_globals->allocMemory(filesize);
+ byte *data = _vm->_globals->allocMemory(filesize+1);
if (!data)
error("Error allocating space for file being loaded - %s", file.c_str());
readStream(f, data, filesize);
f.close();
+ data[filesize] = '\0';
return data;
}