version 1.4.36b
[polyglot.git] / board.c
diff --git a/board.c b/board.c
index b17d354..8c51a88 100644 (file)
--- a/board.c
+++ b/board.c
@@ -459,31 +459,31 @@ void board_disp(const board_t * board) {
    int file, rank, sq;\r
    int piece, c;\r
    char fen[256];\r
+   char row[9];\r
+   char line[256];\r
 \r
    ASSERT(board!=NULL);\r
 \r
    if (!board_to_fen(board,fen,256)) ASSERT(FALSE);\r
-   my_log("POLYGLOT %s\n",fen);\r
-   my_log("POLYGLOT\n");\r
+   my_log("POLYGLOT FEN %s\n",fen);\r
+   my_log("POLYGLOT *** CURRENT BOARD ***\n");\r
 \r
    for (rank = 7; rank >= 0; rank--) {\r
 \r
-      my_log("POLYGLOT ");\r
-\r
       for (file = 0; file < 8; file++) {\r
 \r
          sq = square_make(file,rank);\r
          piece = board->square[sq];\r
 \r
          c = (piece != Empty) ? piece_to_char(piece) : '-';\r
-         my_log("%c ",c);\r
+         row[file]=c;\r
       }\r
-\r
-      my_log("\n");\r
+      row[8]='\0';\r
+      snprintf(line,sizeof(line),"POLYGLOT %s\n",row);\r
+      line[sizeof(line)-1]='\0';\r
+      my_log(line);\r
    }\r
 \r
-   my_log("POLYGLOT\n");\r
-\r
    my_log("POLYGLOT %s to play\n",(colour_is_black(board->turn))?"black":"white");\r
    my_log("POLYGLOT\n");\r
 }\r