diff --git a/lib/libimhex/source/subcommands/subcommands.cpp b/lib/libimhex/source/subcommands/subcommands.cpp index 10c82e67d..e9cc8721a 100644 --- a/lib/libimhex/source/subcommands/subcommands.cpp +++ b/lib/libimhex/source/subcommands/subcommands.cpp @@ -94,9 +94,13 @@ namespace hex::subcommands { void forwardSubCommand(const std::string &cmdName, const std::vector &args) { log::debug("Forwarding subcommand {} (maybe to us)", cmdName); - std::string dataStr = std::accumulate(args.begin(), args.end(), std::string("\0")); - std::vector data(dataStr.begin(), dataStr.end()); + std::vector data; + for (const auto &arg: args) { + data.insert(data.end(), arg.begin(), arg.end()); + data.push_back('\0'); + } + data.erase(data.end()-1); EventManager::post(hex::format("command/{}", cmdName), data); }