mirror of
https://github.com/sockspls/badfish
synced 2025-05-17 07:59: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:
parent
46921dff27
commit
17212e5fcc
1 changed files with 2 additions and 4 deletions
|
@ -292,11 +292,9 @@ namespace {
|
||||||
else if (token == "searchmoves")
|
else if (token == "searchmoves")
|
||||||
{
|
{
|
||||||
int numOfMoves = 0;
|
int numOfMoves = 0;
|
||||||
while (!uip.eof())
|
while (uip >> token)
|
||||||
{
|
|
||||||
uip >> token;
|
|
||||||
searchMoves[numOfMoves++] = move_from_string(RootPosition, token);
|
searchMoves[numOfMoves++] = move_from_string(RootPosition, token);
|
||||||
}
|
|
||||||
searchMoves[numOfMoves] = MOVE_NONE;
|
searchMoves[numOfMoves] = MOVE_NONE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue