Skip to content

Commit

Permalink
AGI: Change set.simple string copy code
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Kiewitz committed Feb 9, 2016
1 parent b51f542 commit f24c251
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions engines/agi/op_cmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f24c251

Please sign in to comment.