From 54e4b7a508548716569fccf732e8dd3cb4e7695f Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 13 Feb 2016 22:07:51 +0100 Subject: [PATCH] E2 turn 966 desaster: code was writing a bad datafile --- src/buildno.h | 2 +- src/kernel/save.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/buildno.h b/src/buildno.h index 48976f45b..9727f88eb 100644 --- a/src/buildno.h +++ b/src/buildno.h @@ -1,3 +1,3 @@ #define VERSION_MAJOR 3 #define VERSION_MINOR 8 -#define VERSION_BUILD 2 +#define VERSION_BUILD 3 diff --git a/src/kernel/save.c b/src/kernel/save.c index 25ae2d858..fe8fbd93d 100644 --- a/src/kernel/save.c +++ b/src/kernel/save.c @@ -1221,7 +1221,7 @@ faction *readfaction(struct gamedata * data) } READ_STR(data->store, name, sizeof(name)); - faction_setpassword(f, (data->version >= CRYPT_VERSION) ? name : password_hash(name, 0, PASSWORD_DEFAULT)); + faction_setpassword(f, (data->version > CRYPT_VERSION) ? name : password_hash(name, 0, PASSWORD_DEFAULT)); if (data->version < NOOVERRIDE_VERSION) { READ_STR(data->store, 0, 0); } @@ -1407,7 +1407,7 @@ int readgame(const char *filename, bool backup) create_backup(path); } - F = fopen(path, "r"); + F = fopen(path, "rb"); if (!F) { perror(path); return -1; @@ -1753,7 +1753,7 @@ int writegame(const char *filename) /* make sure we don't overwrite an existing file (hard links) */ unlink(path); #endif - F = fopen(path, "w"); + F = fopen(path, "wb"); if (!F) { perror(path); return -1;