Merge pull request #179 from adamhathcock/tar_fix

Allow empty tar header to be read to know there are no more tar heade…
This commit is contained in:
Adam Hathcock
2016-09-28 13:57:09 +01:00
committed by GitHub

View File

@@ -164,9 +164,9 @@ namespace SharpCompress.Common.Tar.Headers
{
byte[] buffer = reader.ReadBytes(BlockSize);
if (buffer.Length < BlockSize)
if (buffer.Length != 0 && buffer.Length < BlockSize)
{
throw new InvalidOperationException();
throw new InvalidOperationException("Buffer is invalid size");
}
return buffer;
}