Fix: FormatArrayAsHex returns gibberish instead of a hex array
This commit is contained in:
@@ -135,14 +135,14 @@ char *stredup(const char *s, const char *last)
|
||||
*/
|
||||
std::string FormatArrayAsHex(span<const byte> data)
|
||||
{
|
||||
std::ostringstream ss;
|
||||
ss << std::uppercase << std::setfill('0') << std::setw(2) << std::hex;
|
||||
std::string str;
|
||||
str.reserve(data.size() * 2 + 1);
|
||||
|
||||
for (auto b : data) {
|
||||
ss << b;
|
||||
fmt::format_to(std::back_inserter(str), "{:02X}", b);
|
||||
}
|
||||
|
||||
return ss.str();
|
||||
return str;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user