aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarkt <markt>2007-05-05 23:15:05 (GMT)
committermarkt <markt>2007-05-05 23:15:05 (GMT)
commit1a2779990a777715147df788524ace70ea88c822 (patch)
tree0188eef4100ad49a1cdbadc30df7904b367bcbcc
parent0e778b94d955a8a41cfa298cc14748914a31ec3c (diff)
downloadfluxbox-1a2779990a777715147df788524ace70ea88c822.zip
fluxbox-1a2779990a777715147df788524ace70ea88c822.tar.bz2
checking some return values
-rw-r--r--src/FbTk/FbWindow.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/FbTk/FbWindow.cc b/src/FbTk/FbWindow.cc
index 926abfd..450ca32 100644
--- a/src/FbTk/FbWindow.cc
+++ b/src/FbTk/FbWindow.cc
@@ -465,7 +465,7 @@ void FbWindow::reparent(const FbWindow &parent, int x, int y, bool continuing) {
465std::string FbWindow::textProperty(Atom property) const { 465std::string FbWindow::textProperty(Atom property) const {
466 XTextProperty text_prop; 466 XTextProperty text_prop;
467 char ** stringlist = 0; 467 char ** stringlist = 0;
468 int count; 468 int count = 0;
469 std::string ret; 469 std::string ret;
470 470
471 static Atom m_utf8string = XInternAtom(display(), "UTF8_STRING", False); 471 static Atom m_utf8string = XInternAtom(display(), "UTF8_STRING", False);
@@ -483,16 +483,17 @@ std::string FbWindow::textProperty(Atom property) const {
483 } else if (text_prop.encoding == m_utf8string && text_prop.format == 8) { 483 } else if (text_prop.encoding == m_utf8string && text_prop.format == 8) {
484#ifdef X_HAVE_UTF8_STRING 484#ifdef X_HAVE_UTF8_STRING
485 Xutf8TextPropertyToTextList(display(), &text_prop, &stringlist, &count); 485 Xutf8TextPropertyToTextList(display(), &text_prop, &stringlist, &count);
486 if (count == 0) 486 if (count == 0 || stringlist == 0)
487 return ""; 487 return "";
488#else 488#else
489 if (XTextPropertyToStringList(&text_prop, &stringlist, &count) == 0 || count == 0) 489 if (XTextPropertyToStringList(&text_prop, &stringlist, &count) == 0 || count == 0 || stringlist == 0)
490 return ""; 490 return "";
491#endif 491#endif
492 ret = stringlist[0]; 492 ret = stringlist[0];
493 } else { 493 } else {
494 // still returns a "StringList" despite the different name 494 // still returns a "StringList" despite the different name
495 if (XmbTextPropertyToTextList(display(), &text_prop, &stringlist, &count) == 0 || count == 0) 495 XmbTextPropertyToTextList(display(), &text_prop, &stringlist, &count);
496 if (count == 0 || stringlist == 0)
496 return ""; 497 return "";
497 498
498 ret = FbStringUtil::LocaleStrToFb(stringlist[0]); 499 ret = FbStringUtil::LocaleStrToFb(stringlist[0]);