1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:37:43 +00:00

LibArchive+Utilities: Stop using DeprecatedString

This also slightly improves error propagation in tar, unzip and zip.
This commit is contained in:
implicitfield 2022-12-22 16:21:13 +02:00 committed by Sam Atkins
parent 8377adfde0
commit 28c99e7a1f
10 changed files with 57 additions and 57 deletions

View file

@ -24,10 +24,12 @@ unsigned TarFileHeader::expected_checksum() const
return checksum;
}
void TarFileHeader::calculate_checksum()
ErrorOr<void> TarFileHeader::calculate_checksum()
{
memset(m_checksum, ' ', sizeof(m_checksum));
VERIFY(DeprecatedString::formatted("{:06o}", expected_checksum()).copy_characters_to_buffer(m_checksum, sizeof(m_checksum)));
bool copy_successful = TRY(String::formatted("{:06o}", expected_checksum())).bytes_as_string_view().copy_characters_to_buffer(m_checksum, sizeof(m_checksum));
VERIFY(copy_successful);
return {};
}
bool TarFileHeader::is_zero_block() const