mirror of
https://github.com/ckolivas/lrzip.git
synced 2025-12-06 07:12:00 +01:00
Make read_1g able to read from the tmp outbuf if we decide to read from fd_out.
This commit is contained in:
parent
ff5a5ed054
commit
e7d33e82d0
8
stream.c
8
stream.c
|
|
@ -736,6 +736,14 @@ ssize_t read_1g(rzip_control *control, int fd, void *buf, i64 len)
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (TMP_OUTBUF && fd == control->fd_out) {
|
||||||
|
if (unlikely(control->out_ofs + len > control->out_maxlen))
|
||||||
|
failure("Trying to read beyond out_ofs in tmpoutbuf\n");
|
||||||
|
memcpy(buf, control->tmp_outbuf + control->out_ofs, len);
|
||||||
|
control->out_ofs += len;
|
||||||
|
return len;
|
||||||
|
}
|
||||||
|
|
||||||
read_fd:
|
read_fd:
|
||||||
total = 0;
|
total = 0;
|
||||||
while (len > 0) {
|
while (len > 0) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue