Fix null-termination of internal FEN
authorH.G.Muller <hgm@hgm-xboard.(none)>
Mon, 9 Jun 2014 06:59:01 +0000 (08:59 +0200)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Mon, 9 Jun 2014 06:59:01 +0000 (08:59 +0200)
When setting up a position, pieces of an earlier setup position with
longer FEN could be appended to it, and would be placed off-board
on the last rank.

hachu.c

diff --git a/hachu.c b/hachu.c
index 503d061..11e1222 100644 (file)
--- a/hachu.c
+++ b/hachu.c
@@ -2336,6 +2336,7 @@ Convert (char *fen)
     if(!*fen) break;\r
     fen++;\r
   }\r
+  *p = '\0';\r
   printf("# converted FEN '%s'\n", fenArray);\r
   return fenArray;\r
 }\r