aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/io.c b/io.c
index b715d51..592cf48 100644
--- a/io.c
+++ b/io.c
@@ -662,7 +662,7 @@ mapopen(const char **err, const char *path)
goto Err;
}
p = (void *)f.p;
- ret = read(fd, p, CHUNKSIZ);
+ ret = read(fd, (char *)p + f.n, CHUNKSIZ);
if (ret >= 0)
f.n += ret;
else if (errno != EAGAIN && errno != EWOULDBLOCK)