diff options
author | Colin Snover | 2016-12-11 22:15:04 -0600 |
---|---|---|
committer | Colin Snover | 2016-12-19 14:46:46 -0600 |
commit | 6412b323860e9eb351efd46c57ea65ebd56b2823 (patch) | |
tree | f51a6e506624a83041c5e20dad6af7f75601e8ba | |
parent | a238f720db9f3b6b2122be84d851eafde8efcd99 (diff) | |
download | scummvm-rg350-6412b323860e9eb351efd46c57ea65ebd56b2823.tar.gz scummvm-rg350-6412b323860e9eb351efd46c57ea65ebd56b2823.tar.bz2 scummvm-rg350-6412b323860e9eb351efd46c57ea65ebd56b2823.zip |
SCI32: Fix incorrect parsing of empty |f| text escape code
This sequence is used in Hoyle5 when viewing the rules for a game.
-rw-r--r-- | engines/sci/graphics/text32.cpp | 4 |
1 files 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); |