diff options
-rw-r--r-- | src/frontend/qt_sdl/Platform.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/frontend/qt_sdl/Platform.cpp b/src/frontend/qt_sdl/Platform.cpp index 7ce70ab..125e7ea 100644 --- a/src/frontend/qt_sdl/Platform.cpp +++ b/src/frontend/qt_sdl/Platform.cpp @@ -85,7 +85,9 @@ FILE* OpenFile(const char* path, const char* mode, bool mustexist) return nullptr; } - f.open(QIODevice::ReadWrite); + QIODevice::OpenMode qmode = mode[0] == 'w' ? QIODevice::ReadWrite : QIODevice::ReadOnly; + + f.open(qmode); FILE* file = fdopen(dup(f.handle()), mode); f.close(); |