diff Python/codecs.c @ 37673:606818c33e50 legacy-trunk

Replace INT_MAX with PY_SSIZE_T_MAX.
author Martin v. Löwis <martin@v.loewis.de>
date Thu, 13 Apr 2006 07:52:27 +0000
parents 685e2123864d
children ce5585afc20f
line wrap: on
line diff
--- a/Python/codecs.c	Thu Apr 13 07:37:25 2006 +0000
+++ b/Python/codecs.c	Thu Apr 13 07:52:27 2006 +0000
@@ -56,12 +56,12 @@
     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);