Value of uip.eof() should not be trusted.
input like "go infinite searchmoves " (note space in the end of line)
causes problems.
Check the return value of (uip >> token) instead
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
else if (token == "searchmoves")
{
int numOfMoves = 0;
- while (!uip.eof())
- {
- uip >> token;
+ while (uip >> token)
searchMoves[numOfMoves++] = move_from_string(RootPosition, token);
- }
+
searchMoves[numOfMoves] = MOVE_NONE;
}
}