File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,9 @@ ff::WADInfo ff::get_info_from_wad(const std::string& wad_path) {
1111 throw std::runtime_error{" popen() failed" };
1212 }
1313
14- std::unique_ptr<FILE, decltype (&pclose)> pipe (raw_pipe, pclose);
14+ auto deleter = [](FILE* f) { if (f) pclose (f); };
15+
16+ std::unique_ptr<FILE, decltype (deleter)> pipe (raw_pipe, deleter);
1517
1618 while (fgets (buffer.data (), static_cast <int >(buffer.size ()), pipe.get ()) != nullptr ) {
1719 result.append (buffer.data ());
@@ -20,6 +22,7 @@ ff::WADInfo ff::get_info_from_wad(const std::string& wad_path) {
2022 return result;
2123 };
2224
25+
2326 const auto extract_value = [](const std::string& output, const std::string& name) -> std::string {
2427 std::stringstream ss{output};
2528 std::string line;
You can’t perform that action at this time.
0 commit comments