fix utils/exec

This commit is contained in:
chatlanin 2022-05-10 15:20:02 +03:00
parent fe02073b12
commit 04d004b959

View File

@ -46,11 +46,11 @@ namespace hack::utils
}
}
inline std::string exec(const char* cmd)
inline std::string exec(const std::string& cmd)
{
std::string result;
std::array<char, 128> buffer;
std::unique_ptr<FILE, decltype(&pclose)> pipe(popen(cmd, "r"), pclose);
std::unique_ptr<FILE, decltype(&pclose)> pipe(popen(cmd.c_str(), "r"), pclose);
if (!pipe)
{