Skip to content

Commit 9fe34f6

Browse files
Resolve WString TODO (#6190)
Resolve TODO (XXX) by logging warning message.
1 parent cbeb7c4 commit 9fe34f6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cores/esp32/WString.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <Arduino.h>
2525
#include "WString.h"
2626
#include "stdlib_noniso.h"
27+
#include "esp32-hal-log.h"
2728

2829
/*********************************************/
2930
/* Constructors */
@@ -774,7 +775,8 @@ void String::replace(const String& find, const String& replace) {
774775
if(size == len())
775776
return;
776777
if(size > capacity() && !changeBuffer(size))
777-
return; // XXX: tell user!
778+
log_w("String.Replace() Insufficient space to replace string");
779+
return;
778780
int index = len() - 1;
779781
while(index >= 0 && (index = lastIndexOf(find, index)) >= 0) {
780782
readFrom = wbuffer() + index + find.len();

0 commit comments

Comments
 (0)