aboutsummaryrefslogtreecommitdiff
path: root/engines/tony/font.cpp
diff options
context:
space:
mode:
authorAlyssa Milburn2012-08-28 10:08:37 +0200
committerAlyssa Milburn2012-08-28 10:09:13 +0200
commitfbf771ea55b321e5f7914eb989d82bdd2a579f98 (patch)
treebfb7bbb22cd4e9bb8994069b22c0e16e0aba102c /engines/tony/font.cpp
parente6bd426398c75fb6e268e58508b19307ab0c53eb (diff)
downloadscummvm-rg350-fbf771ea55b321e5f7914eb989d82bdd2a579f98.tar.gz
scummvm-rg350-fbf771ea55b321e5f7914eb989d82bdd2a579f98.tar.bz2
scummvm-rg350-fbf771ea55b321e5f7914eb989d82bdd2a579f98.zip
TONY: Fix stringLen for empty strings.
Diffstat (limited to 'engines/tony/font.cpp')
-rw-r--r--engines/tony/font.cpp3
1 files changed, 3 insertions, 0 deletions
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]);