fix(cbor): reset json stream to dec mode in tohex

We were leaking hex mode into the stream causing the following values to
sometimes be hex.
This commit is contained in:
CJ van den Berg 2026-03-10 13:33:43 +01:00
parent e1eefa2ca9
commit 5994549daf
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -12,6 +12,7 @@
using std::back_inserter;
using std::copy;
using std::domain_error;
using std::dec;
using std::hex;
using std::make_tuple;
using std::numeric_limits;
@ -767,7 +768,7 @@ auto buffer::match_value(iter &b, const iter &e, const extractor &ex) -> bool {
namespace {
static auto tohex(ostream &os, uint8_t v) -> ostream & {
return os << hex << setfill('0') << setw(2) << static_cast<unsigned>(v);
return os << hex << setfill('0') << setw(2) << static_cast<unsigned>(v) << dec;
}
static auto to_json(ostream &os, string_view s) -> ostream & {