From 6412b323860e9eb351efd46c57ea65ebd56b2823 Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Sun, 11 Dec 2016 22:15:04 -0600 Subject: SCI32: Fix incorrect parsing of empty |f| text escape code This sequence is used in Hoyle5 when viewing the rules for a game. --- engines/sci/graphics/text32.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engines/sci/graphics/text32.cpp b/engines/sci/graphics/text32.cpp index 7375fdeffd..181dabc9a8 100644 --- a/engines/sci/graphics/text32.cpp +++ b/engines/sci/graphics/text32.cpp @@ -505,12 +505,12 @@ int16 GfxText32::getTextWidth(const uint index, uint length) const { if (length > 0 && currentChar == 'f') { GuiResourceId fontId = 0; - do { + while (length > 0 && *text >= '0' && *text <= '9') { currentChar = *text++; --length; fontId = fontId * 10 + currentChar - '0'; - } while (length > 0 && *text >= '0' && *text <= '9'); + } if (length > 0) { font = _cache->getFont(fontId); -- cgit v1.2.3