From bae76b7cf6488cd359bd88722b55863dddab3975 Mon Sep 17 00:00:00 2001 From: John Cortell Date: Tue, 9 Nov 2021 07:23:52 -0600 Subject: [PATCH] Further adjustment to EXT case --- include/msgpack/v1/object.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/msgpack/v1/object.hpp b/include/msgpack/v1/object.hpp index a94c77ca..fda54be9 100644 --- a/include/msgpack/v1/object.hpp +++ b/include/msgpack/v1/object.hpp @@ -471,8 +471,12 @@ struct object_stringize_visitor { return true; } bool visit_ext(const char* v, uint32_t size) { - int type = ((size > 0) && (v[0] >= 0)) ? v[0] : -1; - m_os << "\"EXT(type:" << type << ",size:" << size << ")\""; + if (size == 0) { + m_os << "\"EXT(size:0)\""; + } + else { + m_os << "\"EXT(type:" << static_cast(v[0]) << ",size:" << size - 1 << ")\""; + } return true; } bool start_array(uint32_t num_elements) {