2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 13:47:43 +00:00

hecl: Make use of FopenUnique

Makes use of the introduced API function to eliminate the need to
explicit fclose FILE* instances.
This commit is contained in:
Lioncash
2019-08-21 19:33:25 -04:00
parent 9dcf7e7f08
commit fb9e4df372
7 changed files with 127 additions and 103 deletions

View File

@@ -255,7 +255,7 @@ static std::unique_ptr<ToolBase> MakeSelectedTool(hecl::SystemString toolName, T
return std::make_unique<ToolHelp>(info);
}
std::unique_ptr<FILE, decltype(&std::fclose)> fp{hecl::Fopen(toolName.c_str(), _SYS_STR("rb")), std::fclose};
auto fp = hecl::FopenUnique(toolName.c_str(), _SYS_STR("rb"));
if (fp == nullptr) {
LogModule.report(logvisor::Error, fmt(_SYS_STR("unrecognized tool '{}'")), toolNameLower);
return nullptr;