From fbf771ea55b321e5f7914eb989d82bdd2a579f98 Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Tue, 28 Aug 2012 10:08:37 +0200 Subject: TONY: Fix stringLen for empty strings. --- engines/tony/font.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'engines/tony/font.cpp') diff --git a/engines/tony/font.cpp b/engines/tony/font.cpp index 91dd8c0c39..41dfa1f7bf 100644 --- a/engines/tony/font.cpp +++ b/engines/tony/font.cpp @@ -122,6 +122,9 @@ void RMFont::close() { int RMFont::stringLen(const Common::String &text) { uint len, i; + if (text.empty()) + return letterLength('\0'); + len = 0; for (i = 0; i < text.size() - 1; i++) len += letterLength(text[i], text[i + 1]); -- cgit v1.2.3