Unverified Commit 9fe34f65 authored by mrengineer7777's avatar mrengineer7777 Committed by GitHub

Resolve WString TODO (#6190)

Resolve TODO (XXX) by logging warning message.
parent cbeb7c4d
......@@ -24,6 +24,7 @@
#include <Arduino.h>
#include "WString.h"
#include "stdlib_noniso.h"
#include "esp32-hal-log.h"
/*********************************************/
/* Constructors */
......@@ -774,7 +775,8 @@ void String::replace(const String& find, const String& replace) {
if(size == len())
return;
if(size > capacity() && !changeBuffer(size))
return; // XXX: tell user!
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