fixed overflow detection in StringValue::operator[]

This commit is contained in:
Kjistóf 2016-10-23 14:12:13 +02:00
parent c3f6968411
commit 06d045f457

View File

@ -25,7 +25,7 @@ void StringValue::operator--()
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!");
return _data[index];
}