From 1c76e2f7041aae8763d5ef06578e1d93e9bc900d Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Sat, 19 Dec 2015 11:10:40 +0100 Subject: [PATCH] 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. --- backend.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) 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; -- 1.7.0.4