Skip to content
Browse files

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>
  • Loading branch information...
1 parent 320630c commit b82c3021fa4523242c05bc88426c8a794b71167e @mcostalba committed Mar 22, 2009
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/position.cpp
View
2 src/position.cpp
@@ -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));

0 comments on commit b82c302

Please sign in to comment.
Something went wrong with that request. Please try again.