1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:28:12 +00:00

AK/ByteBuffer+Everywhere: Handle errors in ByteBuffer::slice()

This commit is contained in:
Matthias Zimmerman 2022-06-13 05:20:42 -07:00 committed by Linus Groh
parent c0486f93d4
commit c10d48b72c
12 changed files with 45 additions and 34 deletions

View file

@ -27,7 +27,10 @@ static constexpr StringView format_region = "\tBAR {}: {} region @ {:#x}";
static u32 read_hex_string_from_bytebuffer(ByteBuffer const& buf)
{
return AK::StringUtils::convert_to_uint_from_hex(String(buf.slice(2, buf.size() - 2).bytes())).release_value();
// FIXME: Propagate errors.
return AK::StringUtils::convert_to_uint_from_hex(
String(MUST(buf.slice(2, buf.size() - 2)).bytes()))
.release_value();
}
static u32 convert_sysfs_value_to_uint(String const& value)