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.
}
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;