diff options
Diffstat (limited to 'src/libutil/compression.cc')
-rw-r--r-- | src/libutil/compression.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libutil/compression.cc b/src/libutil/compression.cc index 8b50776b3..08812ef57 100644 --- a/src/libutil/compression.cc +++ b/src/libutil/compression.cc @@ -28,7 +28,7 @@ struct ChunkedCompressionSink : CompressionSink const size_t CHUNK_SIZE = sizeof(outbuf) << 2; while (!data.empty()) { size_t n = std::min(CHUNK_SIZE, data.size()); - writeInternal(data); + writeInternal(data.substr(0, n)); data.remove_prefix(n); } } @@ -265,7 +265,8 @@ struct BrotliCompressionSink : ChunkedCompressionSink } }; -std::unique_ptr<Source> makeDecompressionSource(Source & prev) { +std::unique_ptr<Source> makeDecompressionSource(Source & prev) +{ return std::unique_ptr<Source>(new ArchiveDecompressionSource(prev)); } |