aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2009-09-30 13:09:18 +0000
committerFilippos Karapetis2009-09-30 13:09:18 +0000
commitfa077237c1a48aa5b3b56f3697e775f5e05cb08c (patch)
tree895b678e62472dd7778f60804b27249d2236faa3
parent1b94303b788bdad949a954e2ec603ab7003da509 (diff)
downloadscummvm-rg350-fa077237c1a48aa5b3b56f3697e775f5e05cb08c.tar.gz
scummvm-rg350-fa077237c1a48aa5b3b56f3697e775f5e05cb08c.tar.bz2
scummvm-rg350-fa077237c1a48aa5b3b56f3697e775f5e05cb08c.zip
Fixed a crash when starting KQ1SCI
svn-id: r44484
-rw-r--r--engines/sci/engine/kstring.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/engines/sci/engine/kstring.cpp b/engines/sci/engine/kstring.cpp
index 4980e245ac..308d8064a2 100644
--- a/engines/sci/engine/kstring.cpp
+++ b/engines/sci/engine/kstring.cpp
@@ -447,7 +447,7 @@ reg_t kFormat(EngineState *s, int argc, reg_t *argv) {
switch (xfer) {
case 's': { /* Copy string */
reg_t reg = argv[startarg + paramindex];
- Common::String tempsource = kernel_lookup_text(s, reg,
+ Common::String tempsource = (reg == NULL_REG) ? "" : kernel_lookup_text(s, reg,
arguments[paramindex + 1]);
int slen = strlen(tempsource.c_str());
int extralen = str_leng - slen;