[Scummvm-cvs-logs] scummvm master -> c26d3fd62fc7b24035a11d078fa1a340e5151aae

m-kiewitz m_kiewitz at users.sourceforge.net
Tue Feb 9 13:51:41 CET 2016


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
c26d3fd62f AGI: Change set.simple string copy code


Commit: c26d3fd62fc7b24035a11d078fa1a340e5151aae
    https://github.com/scummvm/scummvm/commit/c26d3fd62fc7b24035a11d078fa1a340e5151aae
Author: Martin Kiewitz (m_kiewitz at users.sourceforge.net)
Date: 2016-02-09T13:51:14+01:00

Commit Message:
AGI: Change set.simple string copy code

Changed paths:
    engines/agi/op_cmd.cpp



diff --git a/engines/agi/op_cmd.cpp b/engines/agi/op_cmd.cpp
index 6638698..f7af133 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;






More information about the Scummvm-git-logs mailing list