Use unsigned char as argument of std::isspace
authorMarco Costalba <mcostalba@gmail.com>
Fri, 6 Jun 2014 23:16:31 +0000 (01:16 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Fri, 6 Jun 2014 23:21:47 +0000 (01:21 +0200)
commit4d30126e4b0a64c517fb52ec4c24afdc2645663b
tree13cb2d8b585b66c24a8ede0d4c242271f7e03c11
parent7f56d2949d4244c9d2e6796adc721582e9d85804
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