From d4fd90e06479f76df274a80e20387e3c79515e3a Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Fri, 11 May 2012 00:49:04 +0200 Subject: WINTERMUTE: Fix font-related crash. --- engines/wintermute/BFontBitmap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/wintermute') diff --git a/engines/wintermute/BFontBitmap.cpp b/engines/wintermute/BFontBitmap.cpp index 3bec9d5a20..71bbf95801 100644 --- a/engines/wintermute/BFontBitmap.cpp +++ b/engines/wintermute/BFontBitmap.cpp @@ -166,7 +166,7 @@ int CBFontBitmap::TextHeightDraw(byte *text, int x, int y, int width, TTextAlig long_line = true; } - if (str[index + 1] == '\0' || (MaxLenght >= 0 && index == MaxLenght - 1)) { + if (str.size() == (index + 1) || (MaxLenght >= 0 && index == MaxLenght - 1)) { done = true; if (!new_line) { end = index; -- cgit v1.2.3