From 5994549daf5357cb21d6968f45d92eac7dbfe883 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Tue, 10 Mar 2026 13:33:43 +0100 Subject: [PATCH] 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. --- src/cbor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cbor.cpp b/src/cbor.cpp index 8c328f9..05676a1 100644 --- a/src/cbor.cpp +++ b/src/cbor.cpp @@ -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(v); + return os << hex << setfill('0') << setw(2) << static_cast(v) << dec; } static auto to_json(ostream &os, string_view s) -> ostream & {