aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/BFontBitmap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/wintermute/BFontBitmap.cpp')
-rw-r--r--engines/wintermute/BFontBitmap.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/engines/wintermute/BFontBitmap.cpp b/engines/wintermute/BFontBitmap.cpp
index 4b5b0c6199..9b49a84079 100644
--- a/engines/wintermute/BFontBitmap.cpp
+++ b/engines/wintermute/BFontBitmap.cpp
@@ -92,10 +92,12 @@ int CBFontBitmap::GetTextWidth(byte *text, int MaxLength) {
str = AnsiString((char *)text);
}
- if (MaxLength >= 0 && str.length() > MaxLength) str = str.substr(0, MaxLength);
+ if (MaxLength >= 0 && str.size() > MaxLength)
+ str = Common::String(str.c_str(), MaxLength);
+ //str.substr(0, MaxLength); // TODO: Remove
int TextWidth = 0;
- for (size_t i = 0; i < str.length(); i++) {
+ for (size_t i = 0; i < str.size(); i++) {
TextWidth += GetCharWidth(str[i]);
}