little sanity check

This commit is contained in:
markt 2007-02-25 17:39:47 +00:00
parent 61ed1fcfb0
commit 68aa6be216

View file

@ -292,6 +292,8 @@ unsigned int XmbFontImp::textWidth(const FbString &text, unsigned int len) const
#endif // X_HAVE_UTF8_STRING
string localestr = text;
if (len > localestr.length())
len = localestr.length();
localestr.erase(len, string::npos);
localestr = FbStringUtil::FbStrToLocale(localestr);
XmbTextExtents(m_fontset, localestr.data(), localestr.size(),