Fix sudden crash-proneness
authorH.G.Muller <hgm@hgm-xboard.(none)>
Sun, 8 Jan 2017 16:07:17 +0000 (17:07 +0100)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Sun, 8 Jan 2017 16:07:17 +0000 (17:07 +0100)
Since October 2016 the ICS crashed within minutes, when games are going on.
The cause seems to be a reversed test for bughouse in game_ended(), which
informed players of the availability of the bughouse partners of the ending
game if and only if the game was not bughouse. Accessig bughouse partners
only when they exist seems to have solved the problem.

lasker-2.2.3/src/gameproc.c

index 295aed6..2fb54e8 100644 (file)
@@ -345,7 +345,7 @@ void game_ended(int g, int winner, int why)
           pprintf (p,"\n%s",avail_black);
           avail_printed = 1;
         }
-        if (gl == -1) /* bughouse ? */ {
+        if (gl != -1) /* bughouse ? */ {
           if (((player_globals.parray[game_globals.garray[gl].white].b_stats.rating <= pp->availmax) && (player_globals.parray[game_globals.garray[gl].white].b_stats.rating >= pp->availmin)) || (!pp->availmax)) {
             pprintf (p,"\n%s",avail_bugwhite);
             avail_printed = 1;