Browse Source

Fix system::archiveDir() adding 10k of padding to the end of memory output.

tags/v2.0.0
Andrew Belt 3 years ago
parent
commit
c9fa0e656b
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      src/system.cpp

+ 2
- 0
src/system.cpp View File

@@ -307,6 +307,8 @@ static void archiveDir(const std::string& archivePath, std::vector<uint8_t>* arc
// Open archive for writing
struct archive* a = archive_write_new();
DEFER({archive_write_free(a);});
// For some reason libarchive adds 10k of padding to archive_write_open() (but not archive_write_open_filename()) unless this is set to 0.
archive_write_set_bytes_per_block(a, 0);
archive_write_set_format_ustar(a);
archive_write_add_filter_zstd(a);
assert(0 <= compressionLevel && compressionLevel <= 19);


Loading…
Cancel
Save