forked from espressif/arduino-esp32
Resolve WString TODO (#6190)
Resolve TODO (XXX) by logging warning message.
This commit is contained in:
@ -24,6 +24,7 @@
|
|||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include "WString.h"
|
#include "WString.h"
|
||||||
#include "stdlib_noniso.h"
|
#include "stdlib_noniso.h"
|
||||||
|
#include "esp32-hal-log.h"
|
||||||
|
|
||||||
/*********************************************/
|
/*********************************************/
|
||||||
/* Constructors */
|
/* Constructors */
|
||||||
@ -774,7 +775,8 @@ void String::replace(const String& find, const String& replace) {
|
|||||||
if(size == len())
|
if(size == len())
|
||||||
return;
|
return;
|
||||||
if(size > capacity() && !changeBuffer(size))
|
if(size > capacity() && !changeBuffer(size))
|
||||||
return; // XXX: tell user!
|
log_w("String.Replace() Insufficient space to replace string");
|
||||||
|
return;
|
||||||
int index = len() - 1;
|
int index = len() - 1;
|
||||||
while(index >= 0 && (index = lastIndexOf(find, index)) >= 0) {
|
while(index >= 0 && (index = lastIndexOf(find, index)) >= 0) {
|
||||||
readFrom = wbuffer() + index + find.len();
|
readFrom = wbuffer() + index + find.len();
|
||||||
|
Reference in New Issue
Block a user