diff options
Diffstat (limited to 'engines/sci/engine/kstring.cpp')
-rw-r--r-- | engines/sci/engine/kstring.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/engines/sci/engine/kstring.cpp b/engines/sci/engine/kstring.cpp index 6ec61343b0..74c1f99778 100644 --- a/engines/sci/engine/kstring.cpp +++ b/engines/sci/engine/kstring.cpp @@ -733,11 +733,12 @@ namespace { } bool isSignedType(const char type) { - return type == 'd' || type == 'i'; + // For whatever reason, %d ends up being treated as unsigned in SSCI + return type == 'i'; } bool isUnsignedType(const char type) { - return strchr("uxXoc", type); + return strchr("duxXoc", type); } bool isStringType(const char type) { @@ -805,8 +806,11 @@ Common::String format(const Common::String &source, int argc, const reg_t *argv) continue; } - assert(argIndex < argc); - out += readPlaceholder(in, argv[argIndex++]); + if (argIndex < argc) { + out += readPlaceholder(in, argv[argIndex++]); + } else { + out += readPlaceholder(in, NULL_REG); + } } else { out += *in++; } |