aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Kiewitz2016-02-09 13:51:14 +0100
committerMartin Kiewitz2016-02-09 13:51:14 +0100
commitc26d3fd62fc7b24035a11d078fa1a340e5151aae (patch)
tree50adceaf6f970849363bc77b24e290ba81b58c82
parentf5a83adc01719b8409af12bd864e852bbb1de765 (diff)
downloadscummvm-rg350-c26d3fd62fc7b24035a11d078fa1a340e5151aae.tar.gz
scummvm-rg350-c26d3fd62fc7b24035a11d078fa1a340e5151aae.tar.bz2
scummvm-rg350-c26d3fd62fc7b24035a11d078fa1a340e5151aae.zip
AGI: Change set.simple string copy code
-rw-r--r--engines/agi/op_cmd.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/engines/agi/op_cmd.cpp b/engines/agi/op_cmd.cpp
index 66386987a7..f7af133e03 100644
--- a/engines/agi/op_cmd.cpp
+++ b/engines/agi/op_cmd.cpp
@@ -909,8 +909,9 @@ void cmdSetSimple(AgiGame *state, AgiEngine *vm, uint8 *parameter) {
// Try to get description for automatic saves
textPtr = state->strings[stringNr];
- memset(state->automaticSaveDescription, 0, sizeof(state->automaticSaveDescription));
- strncpy(state->automaticSaveDescription, textPtr, sizeof(state->automaticSaveDescription) - 1);
+ strncpy(state->automaticSaveDescription, textPtr, sizeof(state->automaticSaveDescription));
+ state->automaticSaveDescription[sizeof(state->automaticSaveDescription) - 1] = 0;
+
if (state->automaticSaveDescription[0]) {
// We got it and it's set, so enable automatic saving
state->automaticSave = true;