[Scummvm-cvs-logs] scummvm master -> 85a056f3824151e4f1838de2ca3aeb7e824c32b8

wjp wjp at usecode.org
Mon Jul 18 23:39:51 CEST 2011


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:
85a056f382 SCI: Fix kFormat's handling of %c with a 0 argument


Commit: 85a056f3824151e4f1838de2ca3aeb7e824c32b8
    https://github.com/scummvm/scummvm/commit/85a056f3824151e4f1838de2ca3aeb7e824c32b8
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2011-07-18T14:36:56-07:00

Commit Message:
SCI: Fix kFormat's handling of %c with a 0 argument

SSCI used a sprintf to handle %c, appending the result to the output,
which is effectively a nop for a zero argument.

This is bug #3368821. Thanks to digitall for tracing it to KFormat
and testing this patch.

Changed paths:
    engines/sci/engine/kstring.cpp



diff --git a/engines/sci/engine/kstring.cpp b/engines/sci/engine/kstring.cpp
index 7b8db22..b383f88 100644
--- a/engines/sci/engine/kstring.cpp
+++ b/engines/sci/engine/kstring.cpp
@@ -336,8 +336,9 @@ reg_t kFormat(EngineState *s, int argc, reg_t *argv) {
 				if (align >= 0)
 					while (str_leng-- > 1)
 						*target++ = ' '; /* Format into the text */
-
-				*target++ = arguments[paramindex++];
+				char argchar = arguments[paramindex++];
+				if (argchar)
+					*target++ = argchar;
 				mode = 0;
 			}
 			break;






More information about the Scummvm-git-logs mailing list