Add missing NULL termination to the String::repeat function.

This commit is contained in:
bruvzg 2020-08-11 17:23:44 +03:00
parent 6477481e68
commit 8dab067c01
No known key found for this signature in database
GPG key ID: FCED35F1CECE0D3A

View file

@ -3071,6 +3071,7 @@ String String::repeat(int p_count) const {
const CharType *src = this->c_str(); const CharType *src = this->c_str();
new_string.resize(length() * p_count + 1); new_string.resize(length() * p_count + 1);
new_string[length() * p_count] = 0;
for (int i = 0; i < p_count; i++) for (int i = 0; i < p_count; i++)
for (int j = 0; j < length(); j++) for (int j = 0; j < length(); j++)