all repos — fluxbox @ 008685a90ee1d32b422f7d39011de8a6282d41e5

custom fork of the fluxbox windowmanager

fixing return value checks for utf8 strings
markt markt
commit

008685a90ee1d32b422f7d39011de8a6282d41e5

parent

db2904e1445bfe09c7ea55e2d67f4e51aeca292f

1 files changed, 3 insertions(+), 2 deletions(-)

jump to
M src/FbTk/FbWindow.ccsrc/FbTk/FbWindow.cc

@@ -465,7 +465,7 @@

std::string FbWindow::textProperty(Atom property) const { XTextProperty text_prop; char ** stringlist = 0; - int count; + int count = 0; std::string ret; static Atom m_utf8string = XInternAtom(display(), "UTF8_STRING", False);

@@ -492,7 +492,8 @@ #endif

ret = stringlist[0]; } else { // still returns a "StringList" despite the different name - if (XmbTextPropertyToTextList(display(), &text_prop, &stringlist, &count) == 0 || count == 0) + XmbTextPropertyToTextList(display(), &text_prop, &stringlist, &count); + if (count == 0) return ""; ret = FbStringUtil::LocaleStrToFb(stringlist[0]);