[Python-checkins] cpython: use correct base ptr

benjamin.peterson python-checkins at python.org
Tue Apr 24 00:07:11 CEST 2012


http://hg.python.org/cpython/rev/8dbcedfd13f8
changeset: 76511:8dbcedfd13f8
user: Benjamin Peterson <benjamin at python.org>
date: Mon Apr 23 18:07:01 2012 -0400
summary:
 use correct base ptr
files:
 Objects/unicodeobject.c | 3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -1975,8 +1975,9 @@
 return 127;
 
 kind = PyUnicode_KIND(unicode);
- startptr = PyUnicode_DATA(unicode) + start * kind;
+ startptr = PyUnicode_DATA(unicode);
 endptr = startptr + end * kind;
+ startptr += start * kind;
 switch(kind) {
 case PyUnicode_1BYTE_KIND:
 return ucs1lib_find_max_char(startptr, endptr);
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

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