From 50325209208fe905b653878d7872b327080eb831 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Sat, 11 Jan 2014 12:50:08 +0100 Subject: [PATCH] cut spurious \0 byte from string properties added with 26c263cc1de9cf0af66c12d0d746cd8ae7b1744a CCBUG: 326893 FIXED-IN: 4.11.6 REVIEW: 114963 --- utils.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utils.cpp b/utils.cpp index f725a0e1d4..588634f2d2 100644 --- a/utils.cpp +++ b/utils.cpp @@ -129,14 +129,17 @@ QByteArray getStringProperty(xcb_window_t w, xcb_atom_t prop, char separator) return QByteArray(); } char *data = static_cast(xcb_get_property_value(property.data())); + int length = property->value_len; if (data && separator) { for (uint32_t i = 0; i < property->value_len; ++i) { if (!data[i] && i + 1 < property->value_len) { data[i] = separator; + } else { + length = i; } } } - return QByteArray(data, property->value_len); + return QByteArray(data, length); } #ifndef KCMRULES