From c331fff878505882386d05e25eda78f97c188cbd Mon Sep 17 00:00:00 2001 From: Slyvtt Date: Thu, 2 Feb 2023 22:17:26 +0100 Subject: [PATCH] crash with fwrite function in saveprogress() --- src/src/saves.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/src/saves.cc b/src/src/saves.cc index 3a55e15..b66f277 100644 --- a/src/src/saves.cc +++ b/src/src/saves.cc @@ -33,7 +33,7 @@ void saveprogress( void ) { sizeoffile = sizeof( HallOfFame ); - FILE *file = fopen( filepath, "wb" ); + FILE *file = fopen( filepath, "w" ); fwrite( HallOfFame, sizeoffile, 1, file ); fclose( file ); @@ -44,7 +44,7 @@ void loadprogress( void ) { sizeoffile = sizeof( HallOfFame ); - FILE *file = fopen( filepath, "rb" ); + FILE *file = fopen( filepath, "r" ); fread( HallOfFame, sizeoffile, 1, file ); fclose( file ); @@ -70,7 +70,7 @@ void saveparameters( void ) { sizeoffile = sizeof( PlayerPara ); - FILE *file = fopen( filepara, "wb" ); + FILE *file = fopen( filepara, "w" ); fwrite( PlayerPara, sizeoffile, 1, file ); fclose( file ); @@ -81,7 +81,7 @@ void loadparameters( void ) { sizeoffile = sizeof( PlayerPara ); - FILE *file = fopen( filepara, "rb" ); + FILE *file = fopen( filepara, "r" ); fread( PlayerPara, sizeoffile, 1, file ); fclose( file );