X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=book.c;h=ba7a9afc07921957a6da6fc4d01dd00d7bac8695;hb=81cce2bf79a3fdb0d52f6cd5f40b1d1547443537;hp=82d4a45468923c8a84446c1ed0de14843d5199f3;hpb=91d8e5853ca580769cc130aa6ea004869118d171;p=xboard.git diff --git a/book.c b/book.c index 82d4a45..ba7a9af 100644 --- a/book.c +++ b/book.c @@ -30,6 +30,8 @@ #include #include +#include +#include #include "common.h" #include "backend.h" @@ -273,8 +275,7 @@ uint64 *RandomTurn =Random64+780; uint64 hash(int moveNr) { - char c; - int p, r, f, i, p_enc, squareNr, pieceGroup; + int r, f, p_enc, squareNr, pieceGroup; uint64 key=0, Zobrist; for(f=BOARD_LEFT; f>32), (unsigned int)key); offset=find_key(f, key, &entry); - if(entry.key != key) return NULL; + if(entry.key != key) { + fclose(f); + return NULL; + } entries[0] = entry; count=1; fseek(f, 16*(offset+1), SEEK_SET); @@ -499,7 +503,6 @@ char *ProbeBook(int moveNr, char *book) for(i=0; i> 15; // create random < total_weight total_weight = 0; for(i=0; i