Skip to content

Commit bae76b7

Browse files
Further adjustment to EXT case
1 parent f543d94 commit bae76b7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

include/msgpack/v1/object.hpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -471,8 +471,12 @@ struct object_stringize_visitor {
471471
return true;
472472
}
473473
bool visit_ext(const char* v, uint32_t size) {
474-
int type = ((size > 0) && (v[0] >= 0)) ? v[0] : -1;
475-
m_os << "\"EXT(type:" << type << ",size:" << size << ")\"";
474+
if (size == 0) {
475+
m_os << "\"EXT(size:0)\"";
476+
}
477+
else {
478+
m_os << "\"EXT(type:" << static_cast<int>(v[0]) << ",size:" << size - 1 << ")\"";
479+
}
476480
return true;
477481
}
478482
bool start_array(uint32_t num_elements) {

0 commit comments

Comments
 (0)