summaryrefslogtreecommitdiff
path: root/Objects
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2000-12-19 02:23:19 +0000
committerGuido van Rossum <guido@python.org>2000-12-19 02:23:19 +0000
commit5a5bc85983d7dc89f93afde9a4d06806fc205910 (patch)
treed194da0084283f93b38e6c11dab4f39aeb9a3b88 /Objects
parent4c885da7dffe57b95fbe996d8c02ddae364747da (diff)
downloadcpython-5a5bc85983d7dc89f93afde9a4d06806fc205910.tar.gz
Fix off-by-one error in split_substring(). Fixes SF bug #122162.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/unicodeobject.c2
1 files changed, 1 insertions, 1 deletions
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;