mirror of
https://github.com/sockspls/badfish
synced 2025-07-11 19:49:14 +00:00
Fix a smal bug in Position::from_fen
We could fail to parse an en-passant position in same cases. Merged from iPhone Glaurung. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
320630ca1a
commit
b82c3021fa
1 changed files with 1 additions and 1 deletions
|
@ -190,7 +190,7 @@ void Position::from_fen(const std::string& fen) {
|
|||
i++;
|
||||
|
||||
// En passant square
|
||||
if ( i < fen.length() - 2
|
||||
if ( i <= fen.length() - 2
|
||||
&& (fen[i] >= 'a' && fen[i] <= 'h')
|
||||
&& (fen[i+1] == '3' || fen[i+1] == '6'))
|
||||
st->epSquare = square_from_string(fen.substr(i, 2));
|
||||
|
|
Loading…
Add table
Reference in a new issue