From 87303d7ed307766b51908541512f9a209dc99032 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 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; } } -- 2.39.2