]> granicus.if.org Git - python/commitdiff
Restore a conditional I removed by mistake.
authorAntoine Pitrou <solipsis@pitrou.net>
Sun, 29 Mar 2009 01:09:51 +0000 (01:09 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Sun, 29 Mar 2009 01:09:51 +0000 (01:09 +0000)
Modules/_fileio.c

index 6093b4064ca4a867c5a9ae91cedb85250ce8b1d1..c6b97fbaf61fbdf71884f9b7738a11ac86f8b9aa 100644 (file)
@@ -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;
                }