Skip to content

Commit

Permalink
Fixed error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Core-2-Extreme committed Oct 12, 2023
1 parent b3bcf2c commit b4ca874
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions source/system/menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,13 @@ Result_with_string Menu_update_main_directory(void)
FS_Archive archive = 0;
Result_with_string result;

FSUSER_OpenArchive(&archive, ARCHIVE_SDMC, fsMakePath(PATH_EMPTY, ""));
if(FSUSER_OpenDirectory(&fs_handle, archive, fsMakePath(PATH_ASCII, old_main_dir.c_str())) == 0)
if(FSUSER_OpenArchive(&archive, ARCHIVE_SDMC, fsMakePath(PATH_EMPTY, "")) == 0)
{
FSDIR_Close(fs_handle);
result.code = FSUSER_RenameDirectory(archive, fsMakePath(PATH_ASCII, old_main_dir.c_str()), archive, fsMakePath(PATH_ASCII, new_main_dir.c_str()));
if(FSUSER_OpenDirectory(&fs_handle, archive, fsMakePath(PATH_ASCII, old_main_dir.c_str())) == 0)
{
FSDIR_Close(fs_handle);
result.code = FSUSER_RenameDirectory(archive, fsMakePath(PATH_ASCII, old_main_dir.c_str()), archive, fsMakePath(PATH_ASCII, new_main_dir.c_str()));
}
}
FSUSER_CloseArchive(archive);

Expand Down

0 comments on commit b4ca874

Please sign in to comment.