mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:37:35 +00:00
LibArchive+Utilities: Stop using DeprecatedString
This also slightly improves error propagation in tar, unzip and zip.
This commit is contained in:
parent
8377adfde0
commit
28c99e7a1f
10 changed files with 57 additions and 57 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue