From 9fe34f655369e64d7988c482f9d53a758d4dac01 Mon Sep 17 00:00:00 2001 From: mrengineer7777 <44048235+mrengineer7777@users.noreply.github.com> Date: Mon, 31 Jan 2022 05:07:37 -0600 Subject: [PATCH] Resolve WString TODO (#6190) 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 ded2a3c1..4badf63d 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();