summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorljfa-ag <ljfa-ag@web.de>2015-09-05 13:17:56 +0200
committerljfa-ag <ljfa-ag@web.de>2015-09-05 13:17:56 +0200
commit3b7d44aa0b84f9c208d906f4d10517e36220ee80 (patch)
tree3d20d738d7b45ec34c4abd47baef17d06564e879 /src
parentfd32c7c7d05bc7e823d7e129d16193be4635b0c7 (diff)
downloadProject-Tick-3b7d44aa0b84f9c208d906f4d10517e36220ee80.tar.gz
Project-Tick-3b7d44aa0b84f9c208d906f4d10517e36220ee80.zip
Create constant for maximum list and array length
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");