1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-05-16 15:39:36 +00:00

Remove last use of uip.eof()

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>
This commit is contained in:
Joona Kiiski 2010-01-26 18:55:27 +02:00 committed by Marco Costalba
parent 46921dff27
commit 17212e5fcc

View file

@ -292,11 +292,9 @@ namespace {
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;
}
}