From ed46e223eba88574ec7e58555db933326dd69870 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sun, 7 Jun 2009 23:29:11 +0000 Subject: Hopefully fixed memory corruption when loading games svn-id: r41361 --- engines/sci/engine/savegame.cpp | 4 ++-- 1 file 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); } } -- cgit v1.2.3