diff options
-rw-r--r-- | src/FbTk/XmbFontImp.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/FbTk/XmbFontImp.cc b/src/FbTk/XmbFontImp.cc index b1fd991..025f96d 100644 --- a/src/FbTk/XmbFontImp.cc +++ b/src/FbTk/XmbFontImp.cc | |||
@@ -292,6 +292,8 @@ unsigned int XmbFontImp::textWidth(const FbString &text, unsigned int len) const | |||
292 | #endif // X_HAVE_UTF8_STRING | 292 | #endif // X_HAVE_UTF8_STRING |
293 | 293 | ||
294 | string localestr = text; | 294 | string localestr = text; |
295 | if (len > localestr.length()) | ||
296 | len = localestr.length(); | ||
295 | localestr.erase(len, string::npos); | 297 | localestr.erase(len, string::npos); |
296 | localestr = FbStringUtil::FbStrToLocale(localestr); | 298 | localestr = FbStringUtil::FbStrToLocale(localestr); |
297 | XmbTextExtents(m_fontset, localestr.data(), localestr.size(), | 299 | XmbTextExtents(m_fontset, localestr.data(), localestr.size(), |