From 997c11ef255b9ccc281ac92aa03d9ae56b17bc33 Mon Sep 17 00:00:00 2001 From: Adam Hathcock Date: Sun, 21 Feb 2021 12:14:07 +0000 Subject: [PATCH] Bug fix on counting --- src/SharpCompress/IO/CountingWritableSubStream.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SharpCompress/IO/CountingWritableSubStream.cs b/src/SharpCompress/IO/CountingWritableSubStream.cs index 35e2e5f3..3c1d9393 100644 --- a/src/SharpCompress/IO/CountingWritableSubStream.cs +++ b/src/SharpCompress/IO/CountingWritableSubStream.cs @@ -41,7 +41,7 @@ namespace SharpCompress.IO public override async Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) { await Stream.WriteAsync(buffer, offset, count, cancellationToken); - Count += (uint)buffer.Length; + Count += (uint)count; } public override async ValueTask WriteAsync(ReadOnlyMemory buffer, CancellationToken cancellationToken = default)