mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-07-07 01:52:14 +02:00
Fixed file modes
This commit is contained in:
parent
1a7b9c3428
commit
b7f72323a7
@ -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…
Reference in New Issue
Block a user