We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a301819 commit a7bd375Copy full SHA for a7bd375
1 file changed
src/wadinfo.cpp
@@ -11,7 +11,9 @@ ff::WADInfo ff::get_info_from_wad(const std::string& wad_path) {
11
throw std::runtime_error{"popen() failed"};
12
}
13
14
- std::unique_ptr<FILE, decltype(&pclose)> pipe(raw_pipe, pclose);
+ auto deleter = [](FILE* f) { if (f) pclose(f); };
15
+
16
+ std::unique_ptr<FILE, decltype(deleter)> pipe(raw_pipe, deleter);
17
18
while (fgets(buffer.data(), static_cast<int>(buffer.size()), pipe.get()) != nullptr) {
19
result.append(buffer.data());
@@ -20,6 +22,7 @@ ff::WADInfo ff::get_info_from_wad(const std::string& wad_path) {
20
22
return result;
21
23
};
24
25
26
const auto extract_value = [](const std::string& output, const std::string& name) -> std::string {
27
std::stringstream ss{output};
28
std::string line;
0 commit comments