Unverified Commit 6591f5bd authored by s-hadinger's avatar s-hadinger Committed by GitHub

Fix replace() failing (#6224)

parent 0ea485e5
......@@ -774,9 +774,10 @@ void String::replace(const String& find, const String& replace) {
}
if(size == len())
return;
if(size > capacity() && !changeBuffer(size))
if(size > capacity() && !changeBuffer(size)) {
log_w("String.Replace() Insufficient space to replace string");
return;
}
int index = len() - 1;
while(index >= 0 && (index = lastIndexOf(find, index)) >= 0) {
readFrom = wbuffer() + index + find.len();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment