]> granicus.if.org Git - python/commitdiff
Make s.replace() work with explicit counts exceeding 2Gb.
authorThomas Wouters <thomas@python.org>
Wed, 19 Apr 2006 15:38:01 +0000 (15:38 +0000)
committerThomas Wouters <thomas@python.org>
Wed, 19 Apr 2006 15:38:01 +0000 (15:38 +0000)
Objects/stringobject.c

index a0c6a536c63b1f4bed06d98c630e3319fbebb04b..750882b992deeb2f237f3759701b953ad0e51ad0 100644 (file)
@@ -2524,11 +2524,11 @@ string_replace(PyStringObject *self, PyObject *args)
        char *new_s;
        const Py_ssize_t len = PyString_GET_SIZE(self);
        Py_ssize_t sub_len, repl_len, out_len;
-       int count = -1;
+       Py_ssize_t count = -1;
        PyObject *newobj;
        PyObject *subobj, *replobj;
 
-       if (!PyArg_ParseTuple(args, "OO|i:replace",
+       if (!PyArg_ParseTuple(args, "OO|n:replace",
                              &subobj, &replobj, &count))
                return NULL;