From: H.G. Muller Date: Fri, 26 Mar 2010 20:12:19 +0000 (+0100) Subject: Fix crash on switching to ICS xiangqi game X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=3e0b95b9aa551c36024c8d390611f1c1db6375e2;p=xboard.git Fix crash on switching to ICS xiangqi game The oldBoard was a local variable, and only squares of the old board were initialized. This led to a crash if the copied board was enlarged, and then displayed. The variable is now declared static, so the uninitialized squares contain harmless zeros. --- diff --git a/backend.c b/backend.c index a5e26db..c58c091 100644 --- a/backend.c +++ b/backend.c @@ -1983,7 +1983,7 @@ void VariantSwitch(Board board, VariantClass newVariant) { int newHoldingsWidth, newWidth = 8, newHeight = 8, i, j; - Board oldBoard; + static Board oldBoard; startedFromPositionFile = FALSE; if(gameInfo.variant == newVariant) return;