diff --git a/StringValue.cpp b/StringValue.cpp index 26b8acf..90426ad 100644 --- a/StringValue.cpp +++ b/StringValue.cpp @@ -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]; }