fix(ewmh): Include last desktop name

This commit is contained in:
Michael Carlberg 2016-11-26 06:39:37 +01:00
parent b25fa46ac2
commit 6fe411ea9e

View File

@ -87,8 +87,9 @@ namespace ewmh_util {
vector<string> names;
char buffer[BUFSIZ];
size_t len{0};
for (size_t n = 0, len = 0; n < reply.strings_len; n++) {
for (size_t n = 0; n < reply.strings_len; n++) {
if (reply.strings[n] == '\0') {
names.emplace_back(buffer, len);
len = 0;
@ -97,6 +98,10 @@ namespace ewmh_util {
}
}
if (len) {
names.emplace_back(buffer, len);
}
return names;
}