From e7d2c18742ece8e5564ed7fc53ff24c1a15c3f0e Mon Sep 17 00:00:00 2001 From: me-no-dev Date: Mon, 10 Oct 2016 19:29:25 +0300 Subject: [PATCH] Do not delete printf buffer if not required --- cores/esp32/Print.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cores/esp32/Print.cpp b/cores/esp32/Print.cpp index 9f7b35da..d758478b 100644 --- a/cores/esp32/Print.cpp +++ b/cores/esp32/Print.cpp @@ -60,7 +60,9 @@ size_t Print::printf(const char *format, ...) len = vsnprintf(temp, len+1, format, arg); write((uint8_t*)temp, len); va_end(arg); - delete[] temp; + if(len > 64){ + delete[] temp; + } return len; } /*