From: Joona Kiiski Date: Tue, 26 Jan 2010 16:55:27 +0000 (+0200) Subject: Remove last use of uip.eof() X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=87303d7ed307766b51908541512f9a209dc99032 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 --- diff --git a/src/uci.cpp b/src/uci.cpp index 3812a379..b3a7dc63 100644 --- a/src/uci.cpp +++ b/src/uci.cpp @@ -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; } }