From d0e4774e9509e069ef252a071be2bdd497c810dd Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Sat, 20 Sep 2014 09:29:23 +0200 Subject: [PATCH] Fix spurious setup command at startup The vatiable ptc was used uninitialized when the default game description at the start of the ini file was used in response to LoadGame(NULL), leading to printing of a spurious setup command with garbage piece-to-char table, which would wreck the initial setup of XBoard when it started with legality testing off. --- fairymax.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/fairymax.c b/fairymax.c index 3ec024f..f20bb1f 100644 --- a/fairymax.c +++ b/fairymax.c @@ -345,6 +345,8 @@ int PrintResult(int s) + + K=I; cnt = D(s,-I,I,Q,O,LL|4*S,3); #ifdef SHATRANJ @@ -468,7 +470,7 @@ void PrintOptions() void LoadGame(char *name) { - int i, j, ptc, count=0; char c, buf[80], pieceToChar[80], parent[80]; + int i, j, ptc=0, count=0; char c, buf[80], pieceToChar[80], parent[80]; static int currentVariant; FILE *f; -- 1.7.0.4