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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user