From 3a7942d3e6791a0464be0e1212778896deeb78e1 Mon Sep 17 00:00:00 2001 From: mrengineer7777 <44048235+mrengineer7777@users.noreply.github.com> Date: Tue, 25 Jan 2022 10:48:30 -0600 Subject: [PATCH] Resolve WString TODO Resolve TODO (XXX) by logging warning message. --- cores/esp32/WString.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cores/esp32/WString.cpp b/cores/esp32/WString.cpp index ded2a3c1e78..4badf63d0fe 100644 --- a/cores/esp32/WString.cpp +++ b/cores/esp32/WString.cpp @@ -24,6 +24,7 @@ #include #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();