diff options
author | Filippos Karapetis | 2009-03-11 22:50:06 +0000 |
---|---|---|
committer | Filippos Karapetis | 2009-03-11 22:50:06 +0000 |
commit | 88b44cef241b49a84a31226fee86c739edbb77da (patch) | |
tree | c34f04fb1ed962e62b8055cef128bb8015c8ebba /engines/sci/engine/game.cpp | |
parent | bac7bd00be2ed9dc2da799f35bf01a43303c84c6 (diff) | |
download | scummvm-rg350-88b44cef241b49a84a31226fee86c739edbb77da.tar.gz scummvm-rg350-88b44cef241b49a84a31226fee86c739edbb77da.tar.bz2 scummvm-rg350-88b44cef241b49a84a31226fee86c739edbb77da.zip |
Fix heap corruption when assigning the save game directory
svn-id: r39343
Diffstat (limited to 'engines/sci/engine/game.cpp')
-rw-r--r-- | engines/sci/engine/game.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/engines/sci/engine/game.cpp b/engines/sci/engine/game.cpp index 7fd940fd68..6f2cf4b008 100644 --- a/engines/sci/engine/game.cpp +++ b/engines/sci/engine/game.cpp @@ -525,8 +525,8 @@ void script_set_gamestate_save_dir(EngineState *s, const char *path) { SystemString *str = &s->sys_strings->strings[SYS_STRING_SAVEDIR]; strncpy((char *)str->value, path, str->max_size); - str->value[str->max_size].segment = s->string_frag_segment; // Make sure to terminate - str->value[str->max_size].offset &= 0xff00; // Make sure to terminate + str->value[str->max_size - 1].segment = s->string_frag_segment; // Make sure to terminate + str->value[str->max_size - 1].offset &= 0xff00; // Make sure to terminate } void internal_stringfrag_strncpy(EngineState *s, reg_t *dest, reg_t *src, int len); |