From: Thomas Wouters Date: Wed, 19 Apr 2006 15:38:01 +0000 (+0000) Subject: Make s.replace() work with explicit counts exceeding 2Gb. X-Git-Tag: v2.5a2~109 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dc5f808cbc8003f2256a0faabf27420c43cb8e20;p=python Make s.replace() work with explicit counts exceeding 2Gb. --- diff --git a/Objects/stringobject.c b/Objects/stringobject.c index a0c6a536c6..750882b992 100644 --- a/Objects/stringobject.c +++ b/Objects/stringobject.c @@ -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;