From f3b7d86e25b067ae3b8260df8b58ce55647396cb Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Mon, 23 Apr 2012 18:07:01 -0400 Subject: use correct base ptr --- Objects/unicodeobject.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 95ecfe2..27492c8 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -1975,8 +1975,9 @@ _PyUnicode_FindMaxChar(PyObject *unicode, Py_ssize_t start, Py_ssize_t end) 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); -- cgit v0.12