PyUnicode_Contains(): The memcmp() call didn't take into account the

width of Py_UNICODE.  Good catch, MAL.
This commit is contained in:
Barry Warsaw 2002-08-06 19:03:17 +00:00
parent 496e6581e1
commit 6a043f3fe8
1 changed files with 1 additions and 1 deletions

View File

@ -3765,7 +3765,7 @@ int PyUnicode_Contains(PyObject *container,
else {
end = lhs + (PyUnicode_GET_SIZE(u) - size);
while (lhs <= end) {
if (memcmp(lhs++, rhs, size) == 0) {
if (memcmp(lhs++, rhs, size * sizeof(Py_UNICODE)) == 0) {
result = 1;
break;
}