1
0
Fork 1
mirror of https://github.com/vbatts/tar-split.git synced 2024-12-23 05:46:30 +00:00

tar/asm: don't add a padding entry if it has no bytes

Fixes #65

if the read bytes is 0, then don't even create the entry for that
padding.
This sounds like the solution for the issue opened, but I haven't found
a reproducer for this issue yet. :-\

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
Vincent Batts 2023-07-21 08:59:22 -04:00
parent cad1f451fd
commit b6372414e5
Signed by: vbatts
GPG key ID: E30EFAA812C6E5ED

View file

@ -135,6 +135,9 @@ func NewInputTarStream(r io.Reader, p storage.Packer, fp storage.FilePutter) (io
}
isEOF = true
}
if n == 0 {
break
}
_, err = p.AddEntry(storage.Entry{
Type: storage.SegmentType,
Payload: paddingChunk[:n],