From: H.G. Muller Date: Thu, 7 Oct 2010 09:59:33 +0000 (+0200) Subject: Fix uninitialized variable in book code X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=ceba1a500dfca7b4fb7d074083991cefc5a3cf36;p=xboard.git Fix uninitialized variable in book code The variable ' power' was used uninitialized in case -bookVariation was set to 0, which can be an error even if it was only multiplied by zero. --- diff --git a/book.c b/book.c index 48fbc9d..e19ef0b 100644 --- a/book.c +++ b/book.c @@ -499,7 +499,7 @@ char *ProbeBook(int moveNr, char *book) entries[count++] = entry; } if(appData.bookStrength != 50) { // transform weights - double power, maxWeight = 0.0; + double power = 0, maxWeight = 0.0; if(appData.bookStrength) power = (100.-appData.bookStrength)/appData.bookStrength; for(i=0; i maxWeight) maxWeight = entries[i].weight; for(i=0; i