projects
/
fairystockfish.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
320630c
)
Fix a smal bug in Position::from_fen
author
Marco Costalba
<mcostalba@gmail.com>
Sun, 22 Mar 2009 13:18:25 +0000 (14:18 +0100)
committer
Marco Costalba
<mcostalba@gmail.com>
Sun, 22 Mar 2009 22:52:23 +0000 (23:52 +0100)
We could fail to parse an en-passant position
in same cases.
Merged from iPhone Glaurung.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/position.cpp
patch
|
blob
|
history
diff --git
a/src/position.cpp
b/src/position.cpp
index
b8f7807
..
36db8d2
100644
(file)
--- a/
src/position.cpp
+++ b/
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));