ensure we don't pass a negative int to ctypes functions
Some implementations, e.g. cygwin, use a table lookup that can cast a char to a negative array offset.
This commit is contained in:
parent
9574b6c8ec
commit
7109fb3260
@ -141,11 +141,11 @@ restart:
|
||||
if (p < end) {
|
||||
if ((flags & RPP_SEVENBIT))
|
||||
ch &= 0x7f;
|
||||
if (isalpha(ch)) {
|
||||
if (isalpha((unsigned char)ch)) {
|
||||
if ((flags & RPP_FORCELOWER))
|
||||
ch = (char)tolower(ch);
|
||||
ch = (char)tolower((unsigned char)ch);
|
||||
if ((flags & RPP_FORCEUPPER))
|
||||
ch = (char)toupper(ch);
|
||||
ch = (char)toupper((unsigned char)ch);
|
||||
}
|
||||
*p++ = ch;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user