Check for NUL terminator in MemoryPool::findString()

This commit is contained in:
Benoit Blanchon
2021-11-20 20:30:24 +01:00
parent 43b2e2e774
commit a27398e445
9 changed files with 64 additions and 3 deletions

View File

@ -37,6 +37,12 @@ class String {
return *this;
}
char operator[](unsigned int index) const {
if (index >= _str.size())
return 0;
return _str[index];
}
friend std::ostream& operator<<(std::ostream& lhs, const ::String& rhs) {
lhs << rhs._str;
return lhs;