Skip to content

Commit 1ec5cbc

Browse files
authored
Merge pull request #63 from s-hadinger/patch-1
Fix replace() failing
2 parents fb90d99 + 021b93d commit 1ec5cbc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: cores/esp32/WString.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -774,9 +774,10 @@ void String::replace(const String& find, const String& replace) {
774774
}
775775
if(size == len())
776776
return;
777-
if(size > capacity() && !changeBuffer(size))
777+
if(size > capacity() && !changeBuffer(size)) {
778778
log_w("String.Replace() Insufficient space to replace string");
779779
return;
780+
}
780781
int index = len() - 1;
781782
while(index >= 0 && (index = lastIndexOf(find, index)) >= 0) {
782783
readFrom = wbuffer() + index + find.len();

0 commit comments

Comments
 (0)