aboutsummaryrefslogtreecommitdiff
path: root/engines/hugo/file_v2d.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/hugo/file_v2d.cpp')
-rw-r--r--engines/hugo/file_v2d.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/engines/hugo/file_v2d.cpp b/engines/hugo/file_v2d.cpp
index ffadd17481..0ad89e987e 100644
--- a/engines/hugo/file_v2d.cpp
+++ b/engines/hugo/file_v2d.cpp
@@ -30,7 +30,9 @@
*
*/
+#include "common/debug.h"
#include "common/system.h"
+#include "common/textconsole.h"
#include "hugo/hugo.h"
#include "hugo/file.h"
@@ -167,10 +169,10 @@ const char *FileManager_v2d::fetchString(const int index) {
// Get offset to string[index] (and next for length calculation)
_stringArchive.seek((uint32)index * sizeof(uint32), SEEK_SET);
- uint32 off1, off2;
- if (_stringArchive.read((char *)&off1, sizeof(uint32)) == 0)
- error("An error has occurred: bad String offset");
- if (_stringArchive.read((char *)&off2, sizeof(uint32)) == 0)
+
+ uint32 off1 = _stringArchive.readUint32LE();
+ uint32 off2 = _stringArchive.readUint32LE();
+ if (!off1 || !off2)
error("An error has occurred: bad String offset");
// Check size of string