[Python-checkins] python/dist/src/Objects unicodeobject.c,2.158,2.159

bwarsaw@users.sourceforge.net bwarsaw@users.sourceforge.net
2002年8月06日 12:03:19 -0700


Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv18905
Modified Files:
	unicodeobject.c 
Log Message:
PyUnicode_Contains(): The memcmp() call didn't take into account the
width of Py_UNICODE. Good catch, MAL.
Index: unicodeobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v
retrieving revision 2.158
retrieving revision 2.159
diff -C2 -d -r2.158 -r2.159
*** unicodeobject.c	6 Aug 2002 16:58:21 -0000	2.158
--- unicodeobject.c	6 Aug 2002 19:03:17 -0000	2.159
***************
*** 3766,3770 ****
 	end = lhs + (PyUnicode_GET_SIZE(u) - size);
 	while (lhs <= end) {
! 	 if (memcmp(lhs++, rhs, size) == 0) {
 		result = 1;
 		break;
--- 3766,3770 ----
 	end = lhs + (PyUnicode_GET_SIZE(u) - size);
 	while (lhs <= end) {
! 	 if (memcmp(lhs++, rhs, size * sizeof(Py_UNICODE)) == 0) {
 		result = 1;
 		break;

AltStyle によって変換されたページ (->オリジナル) /