fixed overflow detection in StringValue::operator[]
This commit is contained in:
parent
c3f6968411
commit
06d045f457
@ -25,7 +25,7 @@ void StringValue::operator--()
|
|||||||
|
|
||||||
const char& StringValue::operator[](size_t index) const
|
const char& StringValue::operator[](size_t index) const
|
||||||
{
|
{
|
||||||
if (index > _size-1)
|
if (index > _size - 2)
|
||||||
throw std::out_of_range("Index out of range!");
|
throw std::out_of_range("Index out of range!");
|
||||||
return _data[index];
|
return _data[index];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user