aboutsummaryrefslogtreecommitdiff
path: root/common/str.cpp
diff options
context:
space:
mode:
authorMax Horn2008-10-02 17:17:18 +0000
committerMax Horn2008-10-02 17:17:18 +0000
commit0aa9e6ff4cbbc5a6b56232a7b369f3aa36cce82e (patch)
treec19b0f7dd78c62b1f13fa4d92fee21726abd203f /common/str.cpp
parent36b9fb30532277dd35e601d85509620d2206c87b (diff)
downloadscummvm-rg350-0aa9e6ff4cbbc5a6b56232a7b369f3aa36cce82e.tar.gz
scummvm-rg350-0aa9e6ff4cbbc5a6b56232a7b369f3aa36cce82e.tar.bz2
scummvm-rg350-0aa9e6ff4cbbc5a6b56232a7b369f3aa36cce82e.zip
Ignore String::deleteLastChar when called on an empty string
svn-id: r34718
Diffstat (limited to 'common/str.cpp')
-rw-r--r--common/str.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/common/str.cpp b/common/str.cpp
index 6c48738533..303ed7bfac 100644
--- a/common/str.cpp
+++ b/common/str.cpp
@@ -339,7 +339,8 @@ bool String::matchString(const String &pat) const {
}
void String::deleteLastChar() {
- deleteChar(_size - 1);
+ if (_size > 0)
+ deleteChar(_size - 1);
}
void String::deleteChar(uint32 p) {