diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 429964dd7..c0de5acac 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -16459,7 +16459,7 @@ class serializer { case error_handler_t::strict: { - std::string sn(3, '\0'); + std::string sn(9, '\0'); // NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg,hicpp-vararg) (std::snprintf)(&sn[0], sn.size(), "%.2X", byte); JSON_THROW(type_error::create(316, "invalid UTF-8 byte at index " + std::to_string(i) + ": 0x" + sn, BasicJsonType())); @@ -16554,7 +16554,7 @@ class serializer { case error_handler_t::strict: { - std::string sn(3, '\0'); + std::string sn(9, '\0'); // NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg,hicpp-vararg) (std::snprintf)(&sn[0], sn.size(), "%.2X", static_cast(s.back())); JSON_THROW(type_error::create(316, "incomplete UTF-8 string; last byte: 0x" + sn, BasicJsonType()));