From 68aa6be21661205004e05b49d96f2571df3a8ff7 Mon Sep 17 00:00:00 2001 From: markt Date: Sun, 25 Feb 2007 17:39:47 +0000 Subject: little sanity check --- src/FbTk/XmbFontImp.cc | 2 ++ 1 file changed, 2 insertions(+) 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 #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(), -- cgit v0.11.2