aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/lib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/lib.c b/lib/lib.c
index e80b8b12..43db2e37 100644
--- a/lib/lib.c
+++ b/lib/lib.c
@@ -475,12 +475,12 @@ char *readfileat(int dirfd, char *name, char *ibuf, off_t *plen)
rbuf = buf+rlen;
len -= rlen;
}
- *plen = len = rlen+(buf-ibuf);
+ *plen = len = rlen+(rbuf-buf);
close(fd);
if (rlen<0) {
if (ibuf != buf) free(buf);
- buf = 0;
+ buf = 0;
} else buf[len] = 0;
return buf;