summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/tag_array.cpp4
-rw-r--r--src/tag_list.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/tag_array.cpp b/src/tag_array.cpp
index 8bb8bf72e4..99e32549b7 100644
--- a/src/tag_array.cpp
+++ b/src/tag_array.cpp
@@ -81,7 +81,7 @@ void tag_array<int32_t>::read_payload(io::stream_reader& reader)
template<>
void tag_array<int8_t>::write_payload(io::stream_writer& writer) const
{
- if(size() > INT32_MAX)
+ if(size() > io::stream_writer::max_array_len)
{
writer.get_ostr().setstate(std::ios::failbit);
throw std::length_error("Byte array is too large for NBT");
@@ -93,7 +93,7 @@ void tag_array<int8_t>::write_payload(io::stream_writer& writer) const
template<>
void tag_array<int32_t>::write_payload(io::stream_writer& writer) const
{
- if(size() > INT32_MAX)
+ if(size() > io::stream_writer::max_array_len)
{
writer.get_ostr().setstate(std::ios::failbit);
throw std::length_error("Int array is too large for NBT");
diff --git a/src/tag_list.cpp b/src/tag_list.cpp
index 039bd9b77a..67a3d4c15f 100644
--- a/src/tag_list.cpp
+++ b/src/tag_list.cpp
@@ -116,7 +116,7 @@ void tag_list::read_payload(io::stream_reader& reader)
void tag_list::write_payload(io::stream_writer& writer) const
{
- if(size() > INT32_MAX)
+ if(size() > io::stream_writer::max_array_len)
{
writer.get_ostr().setstate(std::ios::failbit);
throw std::length_error("List is too large for NBT");