diff options
-rw-r--r-- | engines/hopkins/files.cpp | 3 |
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; } |