X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=book.c;h=bd3a49ff14521f327b200f04a672c68a5d1e4d0f;hb=7fb59a9a90f59e4e94ff49e2eb55ba7c24b2ef7b;hp=2c1a06a50f828ad02b5d9be83244bf00253af103;hpb=1e854f2b4c4aa7ed89e5bf7211487c795812899f;p=xboard.git diff --git a/book.c b/book.c index 2c1a06a..bd3a49f 100644 --- a/book.c +++ b/book.c @@ -445,13 +445,13 @@ void move_to_string(char move_s[6], uint16 move) // correct FRC-style castlings in variant normal. // [HGM] This is buggy code! e1h1 could very well be a normal R or Q move. if(!strcmp(move_s,"e1h1")){ - strcpy(move_s,"e1g1"); + safeStrCpy(move_s,"e1g1", 6); }else if(!strcmp(move_s,"e1a1")){ - strcpy(move_s,"e1c1"); + safeStrCpy(move_s,"e1c1", 6); }else if(!strcmp(move_s,"e8h8")){ - strcpy(move_s,"e8g8"); + safeStrCpy(move_s,"e8g8", 6); }else if(!strcmp(move_s,"e8a8")){ - strcpy(move_s,"e8c8"); + safeStrCpy(move_s,"e8c8", 6); } } @@ -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