Skip to content

Commit 59f2da6

Browse files
authored
Merge pull request #995 from sukidog/cpp_master_issue_994
Cpp master issue 994
2 parents 1f663d1 + bae76b7 commit 59f2da6

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

include/msgpack/v1/object.hpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -466,12 +466,17 @@ struct object_stringize_visitor {
466466
m_os << '"';
467467
return true;
468468
}
469-
bool visit_bin(const char* v, uint32_t size) {
470-
(m_os << '"').write(v, static_cast<std::streamsize>(size)) << '"';
469+
bool visit_bin(const char* /*v*/, uint32_t size) {
470+
m_os << "\"BIN(size:" << size << ")\"";
471471
return true;
472472
}
473-
bool visit_ext(const char* /*v*/, uint32_t /*size*/) {
474-
m_os << "EXT";
473+
bool visit_ext(const char* v, uint32_t 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+
}
475480
return true;
476481
}
477482
bool start_array(uint32_t num_elements) {

0 commit comments

Comments
 (0)