mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-04-22 20:44:49 +00:00
Fixed file modes
This commit is contained in:
parent
1a7b9c3428
commit
b7f72323a7
1 changed files with 4 additions and 7 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue