]> git.sesse.net Git - stockfish/blobdiff - src/uci.cpp
Sync with master
[stockfish] / src / uci.cpp
index f82a5f0a967eccf8318fcddd1b799998f0943959..f05a114e51993088df0c20cc2b86dda2bbc5436f 100644 (file)
@@ -220,7 +220,7 @@ string UCI::value(Value v) {
 
   stringstream ss;
 
-  if (abs(v) < VALUE_MATE_IN_MAX_PLY)
+  if (abs(v) < VALUE_MATE - MAX_PLY)
       ss << "cp " << v * 100 / PawnValueEg;
   else
       ss << "mate " << (v > 0 ? VALUE_MATE - v + 1 : -VALUE_MATE - v) / 2;
@@ -232,9 +232,7 @@ string UCI::value(Value v) {
 /// UCI::square() converts a Square to a string in algebraic notation (g1, a7, etc.)
 
 std::string UCI::square(Square s) {
-
-  char sq[] = { char('a' + file_of(s)), char('1' + rank_of(s)), 0 }; // NULL terminated
-  return sq;
+  return std::string{ char('a' + file_of(s)), char('1' + rank_of(s)) };
 }