Skip to content

Commit 723d796

Browse files
committed
SDL: save settings in binary mode
1 parent 595f275 commit 723d796

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/platform/sdl/settings.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ void restorePath(FILE *fp, bool restoreDir) {
140140
// restore window position
141141
//
142142
void restoreSettings(SDL_Rect &rect, int &fontScale, bool debug, bool restoreDir) {
143-
FILE *fp = openConfig("r", debug);
143+
FILE *fp = openConfig("rb", debug);
144144
if (fp) {
145145
rect.x = nextInteger(fp, SDL_WINDOWPOS_UNDEFINED);
146146
rect.y = nextInteger(fp, SDL_WINDOWPOS_UNDEFINED);
@@ -182,7 +182,7 @@ void restoreSettings(SDL_Rect &rect, int &fontScale, bool debug, bool restoreDir
182182
// save the window position
183183
//
184184
void saveSettings(SDL_Window *window, int fontScale, bool debug) {
185-
FILE *fp = openConfig("w", debug);
185+
FILE *fp = openConfig("wb", debug);
186186
if (fp) {
187187
int x, y, w, h;
188188
SDL_GetWindowPosition(window, &x, &y);

0 commit comments

Comments
 (0)