]> git.sesse.net Git - stockfish/commitdiff
Remove last use of uip.eof()
authorJoona Kiiski <joona.kiiski@gmail.com>
Tue, 26 Jan 2010 16:55:27 +0000 (18:55 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Wed, 27 Jan 2010 08:52:15 +0000 (09:52 +0100)
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>
src/uci.cpp

index 3812a3792c17d068cdb0bccd575e2a3922088f34..b3a7dc63ddac5c4dfb342933b7f6b04a0453cf4a 100644 (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;
         }
     }