From: H.G. Muller Date: Fri, 5 Jul 2013 16:32:46 +0000 (+0200) Subject: Fix book creation X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=de8c5060e4d63e6eedc8f0d0e77d23712c04ffe1;hp=c2d598e998107fe4d483b1976ce2d6fd494c88a7;p=xboard.git 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. --- 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;