diff Objects/unicodeobject.c @ 24608:b6707e159909 legacy-trunk

PyUnicode_Contains(): The memcmp() call didn't take into account the width of Py_UNICODE. Good catch, MAL.
author Barry Warsaw <barry@python.org>
date Tue, 06 Aug 2002 19:03:17 +0000
parents 12e146171f3d
children 4181e3a42d0a
line wrap: on
line diff
--- a/Objects/unicodeobject.c	Tue Aug 06 17:47:40 2002 +0000
+++ b/Objects/unicodeobject.c	Tue Aug 06 19:03:17 2002 +0000
@@ -3765,7 +3765,7 @@
     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;
 	    }