From 17212e5fcc348cb9e8c769da8b7d5cfb2cdfb07b Mon Sep 17 00:00:00 2001 From: Joona Kiiski Date: Tue, 26 Jan 2010 18:55:27 +0200 Subject: [PATCH] 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 --- src/uci.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/uci.cpp b/src/uci.cpp index f7ba2067..781fa77f 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; } }