From: H.G.Muller Date: Sat, 19 Dec 2015 10:10:40 +0000 (+0100) Subject: Fix piece command after ID-suffix patch X-Git-Url: http://winboard.nl/cgi-bin?p=xboard.git;a=commitdiff_plain;h=1c76e2f7041aae8763d5ef06578e1d93e9bc900d Fix piece command after ID-suffix patch Piece IDs without suffix or & behind them to make them count for both colors were no longer recognized in 'piece' commands, because there was a null character behind the extracted piece-name field. And this null character was seen as occurring in the suffix string. --- diff --git a/backend.c b/backend.c index 0d7a577..7749cba 100644 --- a/backend.c +++ b/backend.c @@ -8980,7 +8980,7 @@ FakeBookMove: // [HGM] book: we jump here to simulate machine moves after book h } if(sscanf(message, "piece %s %s", buf2, buf1) == 2) { ChessSquare piece = WhitePawn; - char *p=buf2, *q, *s = SUFFIXES, ID = *p; + char *p=message+6, *q, *s = SUFFIXES, ID = *p; if(*p == '+') piece = CHUPROMOTED WhitePawn, ID = *++p; if(q = strchr(s, p[1])) ID += 64*(q - s + 1), p++; piece += CharToPiece(ID & 255) - WhitePawn;