Skip to content

Commit 8d88f75

Browse files
committed
Is it too late to perform an abortion on the developers of Clang?
1 parent 49212ee commit 8d88f75

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/wadinfo.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff 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;

0 commit comments

Comments
 (0)