binary_io fix

This commit is contained in:
MihailRis
2023-11-28 10:03:01 +03:00
parent 7759a63973
commit 4a9a4ddd14
+3 -3
View File
@@ -101,7 +101,7 @@ ubyte BinaryReader::get() {
} }
int16_t BinaryReader::getInt16() { int16_t BinaryReader::getInt16() {
if (pos+2 >= size) { if (pos+2 > size) {
throw std::underflow_error("unexpected end"); throw std::underflow_error("unexpected end");
} }
pos += 2; pos += 2;
@@ -110,7 +110,7 @@ int16_t BinaryReader::getInt16() {
} }
int32_t BinaryReader::getInt32() { int32_t BinaryReader::getInt32() {
if (pos+4 >= size) { if (pos+4 > size) {
throw std::underflow_error("unexpected end"); throw std::underflow_error("unexpected end");
} }
pos += 4; pos += 4;
@@ -121,7 +121,7 @@ int32_t BinaryReader::getInt32() {
} }
int64_t BinaryReader::getInt64() { int64_t BinaryReader::getInt64() {
if (pos+8 >= size) { if (pos+8 > size) {
throw std::underflow_error("unexpected end"); throw std::underflow_error("unexpected end");
} }
pos += 8; pos += 8;