From 3e0b95b9aa551c36024c8d390611f1c1db6375e2 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Fri, 26 Mar 2010 21:12:19 +0100 Subject: [PATCH] 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. --- backend.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) 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; -- 1.7.0.4