From de8c5060e4d63e6eedc8f0d0e77d23712c04ffe1 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Fri, 5 Jul 2013 18:32:46 +0200 Subject: [PATCH] Fix book creation Due to duplicate use of the same file pointer variable the game file would be closed before any games were read from it. --- backend.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend.c b/backend.c index b43a970..43e12ec 100644 --- a/backend.c +++ b/backend.c @@ -15224,7 +15224,7 @@ void CreateBookEvent () { ListGame * lg = (ListGame *) gameList.head; - FILE *f; + FILE *f, *g; int nItem; static int secondTime = FALSE; @@ -15233,8 +15233,8 @@ CreateBookEvent () return; } - if(!secondTime && (f = fopen(appData.polyglotBook, "r"))) { - fclose(f); + if(!secondTime && (g = fopen(appData.polyglotBook, "r"))) { + fclose(g); secondTime++; DisplayNote(_("Book file exists! Try again for overwrite.")); return; -- 1.7.0.4