summaryrefslogtreecommitdiff
path: root/src/Util.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Util.cc')
-rw-r--r--src/Util.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Util.cc b/src/Util.cc
index 9dadb3e1..51477423 100644
--- a/src/Util.cc
+++ b/src/Util.cc
@@ -188,8 +188,9 @@ string textPropertyToString(Display *display, XTextProperty& text_prop) {
string ret;
if (text_prop.value && text_prop.nitems > 0) {
- ret = (char *) text_prop.value;
- if (text_prop.encoding != XA_STRING) {
+ if (text_prop.encoding == XA_STRING) {
+ ret = (char *) text_prop.value;
+ } else {
text_prop.nitems = strlen((char *) text_prop.value);
char **list;