From: Guido van Rossum Date: Tue, 19 Dec 2000 02:23:19 +0000 (+0000) Subject: Fix off-by-one error in split_substring(). Fixes SF bug #122162. X-Git-Tag: v2.1a1~536 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cda4f9a8dca961f9047eb6c5cbe647cec507e1a1;p=python Fix off-by-one error in split_substring(). Fixes SF bug #122162. --- diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 5ee72bd128..4438e89eaf 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -2925,7 +2925,7 @@ PyObject *split_substring(PyUnicodeObject *self, int sublen = substring->length; PyObject *str; - for (i = j = 0; i < len - sublen; ) { + for (i = j = 0; i <= len - sublen; ) { if (Py_UNICODE_MATCH(self, i, substring)) { if (maxcount-- <= 0) break;