Fixed an off-by-one error in _PyUnicode_EqualToASCIIString (issue #28701).
This commit is contained in:
parent
f5894dd646
commit
292dd1b2ad
|
@ -10846,7 +10846,7 @@ non_ready_unicode_equal_to_ascii_string(PyObject *unicode, const char *str)
|
||||||
assert(p);
|
assert(p);
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
unsigned char c = (unsigned char)str[i];
|
unsigned char c = (unsigned char)str[i];
|
||||||
if (c > 128 || p[i] != (wchar_t)c)
|
if (c >= 128 || p[i] != (wchar_t)c)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Reference in New Issue