diff --git a/src/x11/ewmh.cpp b/src/x11/ewmh.cpp index 91301755..560f6db1 100644 --- a/src/x11/ewmh.cpp +++ b/src/x11/ewmh.cpp @@ -87,8 +87,9 @@ namespace ewmh_util { vector 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; }