diff --git a/include/nlohmann/json_view.hpp b/include/nlohmann/json_view.hpp index da9cb05be..fc5c8dd56 100644 --- a/include/nlohmann/json_view.hpp +++ b/include/nlohmann/json_view.hpp @@ -713,7 +713,7 @@ class basic_json_view /// decoded strings); the estimate sizes the output buffer of dump() std::size_t source_extent() const noexcept { - const node* const end = m_doc->tape + m_doc->tape_size; + const node* const end = m_doc->nodes + m_doc->node_count; if ((m_node->flags & detail::view::node_flags::storage) != 0) { return m_node->len; diff --git a/single_include/nlohmann/json_view.hpp b/single_include/nlohmann/json_view.hpp index f83b1c92d..5968845ca 100644 --- a/single_include/nlohmann/json_view.hpp +++ b/single_include/nlohmann/json_view.hpp @@ -4604,7 +4604,7 @@ class basic_json_view /// decoded strings); the estimate sizes the output buffer of dump() std::size_t source_extent() const noexcept { - const node* const end = m_doc->tape + m_doc->tape_size; + const node* const end = m_doc->nodes + m_doc->node_count; if ((m_node->flags & detail::view::node_flags::storage) != 0) { return m_node->len;