-
- Downloads
locale: fix shifted ctype array
Fixes #314. In two's complement, the lowest signed 8-bit number is -128, not -127. By wrongly starting to generate the ctype array starting with -127 instead of -128, we got all the locale ctype questions shifted by one character; For example character 32 (' ') was not considered a space, but 31 was! We didn't see this bug because our C library isspace() and friends are currently implemented without using the locale framework (which is fine, as we only support the "C" locale anyway). However, this bug is apparent in C++, as explained in issue #314: std::isspace() returns the wrong answer, and C++ facilities which use this under the hood - such as reading from an istream which is supposed to stop at a space - also got broken. Signed-off-by:Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
Please register or sign in to comment