fix const

This commit is contained in:
chatlanin
2022-04-07 17:11:02 +03:00
parent ed20a19521
commit fe02073b12
6 changed files with 13 additions and 10 deletions

View File

@@ -48,13 +48,13 @@ namespace hack::utils
inline std::string exec(const char* cmd)
{
std::array<char, 128> buffer;
std::string result;
std::array<char, 128> buffer;
std::unique_ptr<FILE, decltype(&pclose)> pipe(popen(cmd, "r"), pclose);
if (!pipe)
{
throw std::runtime_error("popen() failed!");
throw std::runtime_error("bash cmd failed");
}
while (fgets(buffer.data(), buffer.size(), pipe.get()) != nullptr)