diff --git a/src/Utils.cpp b/src/Utils.cpp index 88b3dc8..0263884 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -421,9 +421,8 @@ std::string Utils::stringFromGVariantByteArray(const GVariant *pVariant) { gsize size; gconstpointer pPtr = g_variant_get_fixed_array(const_cast(pVariant), &size, 1); - std::vector array(size + 1, 0); - memcpy(array.data(), pPtr, size); - return array.data(); + std::string str((char*)pPtr, size); + return str; } }; // namespace ggk