summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2006-04-13 07:37:25 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2006-04-13 07:37:25 (GMT)
commit2a19074a9c58d491712139cd3607c10fddebbebc (patch)
tree8ec99d6a35bb13ed8377bb8982e4d8885bee1955 /Objects
parent2308915b2f3114a592e51053ca788dcb7d0a2541 (diff)
downloadcpython-2a19074a9c58d491712139cd3607c10fddebbebc.zip
cpython-2a19074a9c58d491712139cd3607c10fddebbebc.tar.gz
cpython-2a19074a9c58d491712139cd3607c10fddebbebc.tar.bz2
Replace INT_MAX with PY_SSIZE_T_MAX where string length
are concerned.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/fileobject.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Objects/fileobject.c b/Objects/fileobject.c
index 185caa4..e08afe6 100644
--- a/Objects/fileobject.c
+++ b/Objects/fileobject.c
@@ -823,7 +823,7 @@ file_read(PyFileObject *f, PyObject *args)
buffersize = new_buffersize(f, (size_t)0);
else
buffersize = bytesrequested;
- if (buffersize > INT_MAX) {
+ if (buffersize > PY_SSIZE_T_MAX) {
PyErr_SetString(PyExc_OverflowError,
"requested number of bytes is more than a Python string can hold");
return NULL;
@@ -1098,7 +1098,7 @@ getline_via_fgets(FILE *fp)
assert(*(pvend-1) == '\0');
increment = total_v_size >> 2; /* mild exponential growth */
total_v_size += increment;
- if (total_v_size > INT_MAX) {
+ if (total_v_size > PY_SSIZE_T_MAX) {
PyErr_SetString(PyExc_OverflowError,
"line is longer than a Python string can hold");
Py_DECREF(v);
@@ -1209,7 +1209,7 @@ get_line(PyFileObject *f, int n)
used_v_size = total_v_size;
increment = total_v_size >> 2; /* mild exponential growth */
total_v_size += increment;
- if (total_v_size > INT_MAX) {
+ if (total_v_size > PY_SSIZE_T_MAX) {
PyErr_SetString(PyExc_OverflowError,
"line is longer than a Python string can hold");
Py_DECREF(v);
@@ -1401,7 +1401,7 @@ file_readlines(PyFileObject *f, PyObject *args)
/* Need a larger buffer to fit this line */
nfilled += nread;
buffersize *= 2;
- if (buffersize > INT_MAX) {
+ if (buffersize > PY_SSIZE_T_MAX) {
PyErr_SetString(PyExc_OverflowError,
"line is longer than a Python string can hold");
goto error;