Fixed length in TarHeader#WriteStringBytes

This commit is contained in:
majoreffort
2018-07-23 19:58:37 +02:00
committed by GitHub
parent ec044e6f42
commit 2fd6178aa9

View File

@@ -181,7 +181,7 @@ namespace SharpCompress.Common.Tar.Headers
{
int i;
for (i = 0; i < length - 1 && i < name.Length; ++i)
for (i = 0; i < length && i < name.Length; ++i)
{
buffer[offset + i] = (byte)name[i];
}
@@ -272,4 +272,4 @@ namespace SharpCompress.Common.Tar.Headers
public string Magic { get; set; }
}
}
}