Make sure index into hex array is positive

This commit is contained in:
2024-01-19 17:33:30 -08:00
parent 9774a8af2b
commit 7ad68231a4

View File

@@ -729,7 +729,7 @@ void lastLeqMulti(Arena &arena, Node *root, std::span<Key> keys,
for (auto iter = extrema(node, false); iter != nullptr;) {
auto *next = ::next(iter, true);
std::string key;
for (auto c : std::string_view((const char *)(iter + 1), iter->len)) {
for (uint8_t c : std::string_view((const char *)(iter + 1), iter->len)) {
key += "x";
key += "0123456789abcdef"[c / 16];
key += "0123456789abcdef"[c % 16];
@@ -1200,7 +1200,7 @@ struct ReferenceImpl {
void printLogical(std::string &result) {
for (const auto &[k, v] : writeVersionMap) {
std::string key;
for (auto c : k) {
for (uint8_t c : k) {
key += "x";
key += "0123456789abcdef"[c / 16];
key += "0123456789abcdef"[c % 16];