fix utils/exec
This commit is contained in:
parent
fe02073b12
commit
04d004b959
@ -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::string result;
|
||||||
std::array<char, 128> buffer;
|
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)
|
if (!pipe)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user