From 9041daa9a757a7bf0c5924d2cad39cc497b13274 Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Sun, 29 Mar 2009 01:09:51 +0000 Subject: [PATCH] Restore a conditional I removed by mistake. --- Modules/_fileio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/_fileio.c b/Modules/_fileio.c index 6093b4064ca..c6b97fbaf61 100644 --- a/Modules/_fileio.c +++ b/Modules/_fileio.c @@ -506,7 +506,7 @@ new_buffersize(PyFileIOObject *self, size_t currentsize) actually be streaming pseudo-files. In this case, we apply the more aggressive algorithm below. */ - if (end >= SMALLCHUNK && pos >= 0) { + if (end >= SMALLCHUNK && end >= pos && pos >= 0) { /* Add 1 so if the file were to grow we'd notice. */ return currentsize + end - pos + 1; }