mirror of
https://github.com/sockspls/badfish
synced 2025-05-01 09:13:08 +00:00
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.
This commit is contained in:
parent
7f56d2949d
commit
4d30126e4b
1 changed files with 1 additions and 1 deletions
|
@ -226,7 +226,7 @@ void Position::set(const string& fenStr, bool isChess960, Thread* th) {
|
||||||
incremented after Black's move.
|
incremented after Black's move.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
char col, row, token;
|
unsigned char col, row, token;
|
||||||
size_t idx;
|
size_t idx;
|
||||||
Square sq = SQ_A8;
|
Square sq = SQ_A8;
|
||||||
std::istringstream ss(fenStr);
|
std::istringstream ss(fenStr);
|
||||||
|
|
Loading…
Add table
Reference in a new issue