From b7f72323a72cb9b4ce65240b825f65959f222039 Mon Sep 17 00:00:00 2001 From: Adubbz Date: Fri, 9 Aug 2019 11:36:49 +1000 Subject: [PATCH] Fixed file modes --- stratosphere/ncm/source/ncm_fs.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/stratosphere/ncm/source/ncm_fs.cpp b/stratosphere/ncm/source/ncm_fs.cpp index ea5537d6e..7c8f2b7a1 100644 --- a/stratosphere/ncm/source/ncm_fs.cpp +++ b/stratosphere/ncm/source/ncm_fs.cpp @@ -38,14 +38,11 @@ namespace sts::ncm { const char* fopen_mode = ""; - /* Append is forced regardless of whether we set + as the mode. - We do so so the file doesn't get deleted. */ - if (mode & FS_OPEN_READ) { + if (mode & FS_OPEN_WRITE) { fopen_mode = "r+b"; - } else if (mode & FS_OPEN_WRITE) { - fopen_mode = "w+b"; - } - + } else if (mode & FS_OPEN_READ) { + fopen_mode = "rb"; + } FILE* f = fopen(path, fopen_mode); if (f == nullptr) {