diff options
Diffstat (limited to 'src/restore.cpp')
| -rw-r--r-- | src/restore.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/restore.cpp b/src/restore.cpp index f0c4c9e..5b490d9 100644 --- a/src/restore.cpp +++ b/src/restore.cpp @@ -63,17 +63,16 @@ restore(const OptionsRestore &opts) uint64_t size{diff_reader.readSize()}; while (size > 0) { - char *data; - const size_t r{diff_reader.readData(size, &data)}; - if (r == 0) { + const FormatV2::RecordData rd{diff_reader.readRecordData(size)}; + if (rd.size == 0) { break; } - if (!out_file.write(data, r)) { + if (!out_file.write(rd.data.get(), rd.size)) { throw RestoreError("cannot write to output file"); } - size -= r; + size -= rd.size; } if (size > 0) { |
