aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2009-06-07 23:29:11 +0000
committerFilippos Karapetis2009-06-07 23:29:11 +0000
commited46e223eba88574ec7e58555db933326dd69870 (patch)
treec06ccf8f02121abe5953bb78478c70b8cd4d9c53 /engines
parent22507d70bbe06b1da8cbb2599cfbf3114ca41fa7 (diff)
downloadscummvm-rg350-ed46e223eba88574ec7e58555db933326dd69870.tar.gz
scummvm-rg350-ed46e223eba88574ec7e58555db933326dd69870.tar.bz2
scummvm-rg350-ed46e223eba88574ec7e58555db933326dd69870.zip
Hopefully fixed memory corruption when loading games
svn-id: r41361
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/engine/savegame.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp
index b04e5b144a..146d65b56d 100644
--- a/engines/sci/engine/savegame.cpp
+++ b/engines/sci/engine/savegame.cpp
@@ -798,8 +798,8 @@ EngineState *gamestate_restore(EngineState *s, Common::SeekableReadStream *fh) {
str = &retval->sys_strings->strings[i];
char *data = (char *)str->value;
if (data) {
- str->value = (reg_t *)calloc(str->max_size+1, sizeof(char)); // FIXME -- sizeof(char) or sizeof(reg_t) ??
- strncpy((char *)str->value, data, str->max_size+1); // FIXME -- strncpy or internal_stringfrag_strncpy ?
+ str->value = (reg_t *)calloc(str->max_size + 1, sizeof(reg_t));
+ strncpy((char *)str->value, data, str->max_size + 1); // FIXME -- strncpy or internal_stringfrag_strncpy ?
free(data);
}
}