]> git.sesse.net Git - stockfish/blobdiff - src/uci.cpp
Further tweak accurate pv
[stockfish] / src / uci.cpp
index 819e02bc96fec698f37a71013453f7230b2939c1..0f67c4401fd6a0b53fef53a27118e63dc0ff626e 100644 (file)
@@ -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")
@@ -203,7 +204,7 @@ void UCI::loop(int argc, char* argv[]) {
       else if (token == "setoption")  setoption(is);
       else if (token == "flip")       pos.flip();
       else if (token == "bench")      benchmark(pos, is);
-      else if (token == "d")          sync_cout << pos.pretty() << sync_endl;
+      else if (token == "d")          sync_cout << pos << sync_endl;
       else if (token == "isready")    sync_cout << "readyok" << sync_endl;
       else if (token == "eval")       sync_cout << Eval::trace(pos) << sync_endl;
       else
@@ -241,7 +242,8 @@ string UCI::format_value(Value v, Value alpha, Value beta) {
 
 std::string UCI::format_square(Square s) {
 
-  char ch[] = { 'a' + file_of(s), '1' + rank_of(s), 0 }; // Zero-terminating
+  char ch[] = { char('a' + file_of(s)),
+                char('1' + rank_of(s)), 0 }; // Zero-terminating
   return ch;
 }