ULTIMA: Fix crashes in String::erase

This commit is contained in:
Paul Gilbert 2020-01-30 19:14:13 -08:00 committed by Paul Gilbert
parent 05e252816a
commit e8eb67f82e
2 changed files with 1 additions and 2 deletions

View File

@ -434,7 +434,7 @@ void String::deleteChar(uint32 p) {
}
void String::erase(uint32 p, uint32 len) {
if (p == npos)
if (p == npos || len == 0)
return;
assert(p < _size);

View File

@ -31,7 +31,6 @@ namespace Std {
class string : public Common::String {
public:
typedef size_t size_type;
static const size_type npos = (size_type) - 1;
struct reverse_iterator {
private: