Open files as text, not binary.

This commit is contained in:
onpon4 2017-03-28 10:35:11 -04:00
parent 9c089a5013
commit 209a007775
2 changed files with 6 additions and 6 deletions

View File

@ -219,7 +219,7 @@ void engine_setMode()
FILE *fp;
sprintf(filename, "%sconf", engine.configDirectory);
fp = fopen(filename, "rb");
fp = fopen(filename, "r");
if (fp != NULL)
{
@ -383,7 +383,7 @@ void engine_cleanup()
// Save the config using current settings
FILE *fp;
sprintf(filename, "%sconf", engine.configDirectory);
fp = fopen(filename, "wb");
fp = fopen(filename, "w");
if (fp != NULL)
{
fprintf(fp, "%d %d %d %d\n", engine.fullScreen, engine.useSound,

View File

@ -60,7 +60,7 @@ int save_initSlots()
for (int i = 0 ; i <= 5 ; i++)
{
sprintf(fileName, "%ssave%.2d.sav", engine.configDirectory, i);
fp = fopen(fileName, "rb");
fp = fopen(fileName, "r");
if (fp != NULL)
{
if (fscanf(fp, "%d%*c", &game.saveFormat) < 1)
@ -105,7 +105,7 @@ int save_initSlots()
{
sprintf(fileName, "%ssave%.2d.dat", engine.configDirectory, i);
fp = fopen(fileName, "rb");
fp = fopen(fileName, "r");
if (fp == NULL)
{
sprintf(saveSlot[i], (i == 0 ? "AUTOSAVE (Empty)" : "Empty"));
@ -162,7 +162,7 @@ int save_load(int slot)
unsigned long timeTaken;
sprintf(filename, "%ssave%.2d.sav", engine.configDirectory, slot);
fp = fopen(filename, "rb");
fp = fopen(filename, "r");
if (fp != NULL)
{
@ -280,7 +280,7 @@ void save(int slot)
}
sprintf(fileName, "%ssave%.2d.sav", engine.configDirectory, slot);
fp = fopen(fileName, "wb");
fp = fopen(fileName, "w");
game.saveFormat = 4;