From 97e61ddb0ecfe410af57687f5b264992033ccf91 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 29 Sep 2019 11:33:24 -0700 Subject: GLK: QUEST: Fix crash printing formatted strings --- engines/glk/quest/geas_runner.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/glk/quest/geas_runner.cpp b/engines/glk/quest/geas_runner.cpp index f52a89b690..9d4fd32846 100644 --- a/engines/glk/quest/geas_runner.cpp +++ b/engines/glk/quest/geas_runner.cpp @@ -3647,7 +3647,7 @@ GeasResult GeasInterface::print_formatted(String s, bool with_newline) { for (j = i; i != s.length() && s[i] != '|'; i ++) ; print_normal(s.substr(j, i - j)); - if (s[i] == '|') + if (i != s.length() && s[i] == '|') -- i; } } -- cgit v1.2.3