From: Rodrigo Exterckötter Tjäder Date: Sun, 16 Nov 2014 23:48:30 +0000 (+0800) Subject: Clear token before reading from input X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=99f2c1a2a64cac94ee56324fa25f8fba04cd1347;hp=3b1f552b08b254a5b2d8234ba35d52d3ee86a7cb Clear token before reading from input Previously token would keep its value from the previous line when an empty line was input, leading to unexpected behaviour. No functional change Resolves #119 --- diff --git a/src/uci.cpp b/src/uci.cpp index ee1b0702..0f67c440 100644 --- a/src/uci.cpp +++ b/src/uci.cpp @@ -157,6 +157,7 @@ void UCI::loop(int argc, char* argv[]) { istringstream is(cmd); + token.clear(); // getline() could return empty or blank line is >> skipws >> token; if (token == "quit" || token == "stop" || token == "ponderhit")