]> granicus.if.org Git - python/commitdiff
Fix off-by-one error in split_substring(). Fixes SF bug #122162.
authorGuido van Rossum <guido@python.org>
Tue, 19 Dec 2000 02:23:19 +0000 (02:23 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 19 Dec 2000 02:23:19 +0000 (02:23 +0000)
Objects/unicodeobject.c

index 5ee72bd128df8d94638c2113debf50d2acac44e5..4438e89eaf43a725cb9d4c8301f67cdfe87cddaf 100644 (file)
@@ -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;