Replace INT_MAX with PY_SSIZE_T_MAX.

This commit is contained in:
Martin v. Löwis 2006-04-13 07:52:27 +00:00
parent 2a19074a9c
commit b1ed7fac12
5 changed files with 11 additions and 12 deletions

View file

@ -56,12 +56,12 @@ PyObject *normalizestring(const char *string)
char *p;
PyObject *v;
if (len > INT_MAX) {
PyErr_SetString(PyExc_OverflowError, "string is too large");
return NULL;
}
if (len > PY_SSIZE_T_MAX) {
PyErr_SetString(PyExc_OverflowError, "string is too large");
return NULL;
}
v = PyString_FromStringAndSize(NULL, (int)len);
v = PyString_FromStringAndSize(NULL, len);
if (v == NULL)
return NULL;
p = PyString_AS_STRING(v);