Allow patched arrays to start with 0x

This commit is contained in:
Adrian
2023-02-13 15:16:37 +00:00
committed by Radosław Gliński
parent c74a047655
commit 84571f8fe6
2 changed files with 8 additions and 3 deletions

View File

@@ -112,7 +112,11 @@ inline size_t copy_and_swap_maybe_truncating(char16_t* dest,
}
inline bool hex_string_to_array(std::vector<uint8_t>& output_array,
const std::string_view value) {
std::string_view value) {
if (value.rfind("0x", 0) == 0) {
value.remove_prefix(2);
}
output_array.reserve((value.size() + 1) / 2);
size_t remaining_length = value.size();