aboutsummaryrefslogtreecommitdiffhomepage
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/io.c b/io.c
index d8652e3..d85d8d3 100644
--- a/io.c
+++ b/io.c
@@ -637,8 +637,8 @@ mapopen(const char **err, const char *path)
int ret;
do {
- enum { CHUNKSIZ = 1<<16 };
- if ((cap += CHUNKSIZ) < CHUNKSIZ) {
+ enum { CHUNKSIZ = 1<<10 };
+ if (f.n + CHUNKSIZ >= cap && (cap += CHUNKSIZ) < CHUNKSIZ) {
/* overflow */
free(p);
goto Big;