Make TarStream::read_contents take any pointer as output

This commit is contained in:
apio 2022-12-23 10:51:55 +01:00
parent 34e6c05cef
commit c39e54b7c6
Signed by: apio
GPG Key ID: B8A7D06E42258954
2 changed files with 2 additions and 2 deletions

View File

@ -32,7 +32,7 @@ class TarStream
void rewind();
usize read_contents(const Entry& entry, char* buf, usize offset, usize length);
usize read_contents(const Entry& entry, void* buf, usize offset, usize length);
Result<OwnedStringView> read_contents_as_string(const Entry& entry, usize offset, usize max);

View File

@ -87,7 +87,7 @@ Result<TarStream::Entry> TarStream::read_next_entry()
return parse_header(&header);
}
usize TarStream::read_contents(const Entry& entry, char* buf, usize offset, usize length)
usize TarStream::read_contents(const Entry& entry, void* buf, usize offset, usize length)
{
if (offset >= entry.size) return 0;
if ((length + offset) > entry.size) length = entry.size - offset;