From cda4f9a8dca961f9047eb6c5cbe647cec507e1a1 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Tue, 19 Dec 2000 02:23:19 +0000 Subject: [PATCH] Fix off-by-one error in split_substring(). Fixes SF bug #122162. --- Objects/unicodeobject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 5ee72bd128d..4438e89eaf4 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;