mirror of
https://github.com/ckolivas/lrzip.git
synced 2026-04-21 06:03:54 +00:00
Store the file size as zero when the magic header will be written before the size is known.
This commit is contained in:
parent
a10d423596
commit
d87df4f44e
3 changed files with 6 additions and 2 deletions
5
lrzip.c
5
lrzip.c
|
|
@ -57,7 +57,10 @@ void write_magic(rzip_control *control, int fd_in, int fd_out)
|
|||
if (unlikely(fstat(fd_in, &st)))
|
||||
fatal("bad magic file descriptor!?\n");
|
||||
|
||||
memcpy(&magic[6], &control->st_size, 8);
|
||||
/* File size is stored as zero for streaming STDOUT blocks when the
|
||||
* file size is unknown. */
|
||||
if (!STDIN || !STDOUT || control->eof)
|
||||
memcpy(&magic[6], &control->st_size, 8);
|
||||
|
||||
/* save LZMA compression flags */
|
||||
if (LZMA_COMPRESS) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue