From 4d30126e4b0a64c517fb52ec4c24afdc2645663b Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Sat, 7 Jun 2014 01:16:31 +0200 Subject: [PATCH] Use unsigned char as argument of std::isspace Although signature allows an int: int isspace( int ch ); The behavior is undefined if the value of ch is not representable as unsigned char and is not equal to EOF. See http://en.cppreference.com/w/cpp/string/byte/isspace http://www.greenend.org.uk/rjk/tech/cfu.html This is really a tricky corner case of C standard! Spotted and reported by Ron Britvich. No functional change. --- src/position.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/position.cpp b/src/position.cpp index 982352c5..2d511938 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -226,7 +226,7 @@ void Position::set(const string& fenStr, bool isChess960, Thread* th) { incremented after Black's move. */ - char col, row, token; + unsigned char col, row, token; size_t idx; Square sq = SQ_A8; std::istringstream ss(fenStr); -- 2.39.2