mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-21 17:46:26 +08:00
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
This commit is contained in:
committed by
Gary Linscott
parent
3b1f552b08
commit
99f2c1a2a6
@@ -157,6 +157,7 @@ void UCI::loop(int argc, char* argv[]) {
|
|||||||
|
|
||||||
istringstream is(cmd);
|
istringstream is(cmd);
|
||||||
|
|
||||||
|
token.clear(); // getline() could return empty or blank line
|
||||||
is >> skipws >> token;
|
is >> skipws >> token;
|
||||||
|
|
||||||
if (token == "quit" || token == "stop" || token == "ponderhit")
|
if (token == "quit" || token == "stop" || token == "ponderhit")
|
||||||
|
|||||||
Reference in New Issue
Block a user