Skip to content

Commit

Permalink
rosalina: fix bug where config file wasn't closed nor truncated
Browse files Browse the repository at this point in the history
  • Loading branch information
TuxSH committed Jan 16, 2021
1 parent 505a17b commit be6d642
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sysmodules/rosalina/source/menus/miscellaneous.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,11 @@ void MiscellaneousMenu_SaveSettings(void)
FS_ArchiveID archiveId = isSdMode ? ARCHIVE_SDMC : ARCHIVE_NAND_RW;
res = IFile_Open(&file, archiveId, fsMakePath(PATH_EMPTY, ""), fsMakePath(PATH_ASCII, "/luma/config.bin"), FS_OPEN_CREATE | FS_OPEN_WRITE);

if(R_SUCCEEDED(res))
res = IFile_SetSize(&file, sizeof(configData));
if(R_SUCCEEDED(res))
res = IFile_Write(&file, &total, &configData, sizeof(configData), 0);
IFile_Close(&file);

Draw_Lock();
Draw_ClearFramebuffer();
Expand Down

0 comments on commit be6d642

Please sign in to comment.