mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-07-07 10:02: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 = "";
|
const char* fopen_mode = "";
|
||||||
|
|
||||||
/* Append is forced regardless of whether we set + as the mode.
|
if (mode & FS_OPEN_WRITE) {
|
||||||
We do so so the file doesn't get deleted. */
|
|
||||||
if (mode & FS_OPEN_READ) {
|
|
||||||
fopen_mode = "r+b";
|
fopen_mode = "r+b";
|
||||||
} else if (mode & FS_OPEN_WRITE) {
|
} else if (mode & FS_OPEN_READ) {
|
||||||
fopen_mode = "w+b";
|
fopen_mode = "rb";
|
||||||
}
|
}
|
||||||
|
|
||||||
FILE* f = fopen(path, fopen_mode);
|
FILE* f = fopen(path, fopen_mode);
|
||||||
|
|
||||||
if (f == nullptr) {
|
if (f == nullptr) {
|
||||||
|
Loading…
Reference in New Issue
Block a user