Skip to content

Commit

Permalink
Fixed issue with UBJSON encode of json byte array
Browse files Browse the repository at this point in the history
  • Loading branch information
danielaparker committed Sep 25, 2023
1 parent 8e77f7c commit 27700e0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions include/jsoncons_ext/ubjson/ubjson_encoder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,9 @@ class basic_ubjson_encoder final : public basic_json_visitor<char>

const size_t length = b.size();
sink_.push_back(jsoncons::ubjson::ubjson_type::start_array_marker);
binary::native_to_big(static_cast<uint8_t>(jsoncons::ubjson::ubjson_type::type_marker), std::back_inserter(sink_));
binary::native_to_big(static_cast<uint8_t>(jsoncons::ubjson::ubjson_type::uint8_type), std::back_inserter(sink_));
sink_.push_back(static_cast<uint8_t>(jsoncons::ubjson::ubjson_type::type_marker));
sink_.push_back(static_cast<uint8_t>(jsoncons::ubjson::ubjson_type::uint8_type));
sink_.push_back(jsoncons::ubjson::ubjson_type::count_marker);
put_length(length);

for (auto c : b)
Expand Down

0 comments on commit 27700e0

Please sign in to comment.