aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/str.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/common/str.cpp b/common/str.cpp
index 05be3b9e6b..47dd6eef8c 100644
--- a/common/str.cpp
+++ b/common/str.cpp
@@ -216,6 +216,7 @@ void String::toLowercase() {
if (_str == 0 || _len == 0)
return;
+ ensureCapacity(_len, true);
for (int i = 0; i < _len; ++i)
_str[i] = tolower(_str[i]);
}
@@ -224,6 +225,7 @@ void String::toUppercase() {
if (_str == 0 || _len == 0)
return;
+ ensureCapacity(_len, true);
for (int i = 0; i < _len; ++i)
_str[i] = toupper(_str[i]);
}