From 12b3bedba78d53fd3fe1bbee7e5c3d7f7db2671c Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Sat, 25 Oct 2025 16:55:52 +0200 Subject: [PATCH] cleanup - removed old code in comments --- wled00/util.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/wled00/util.cpp b/wled00/util.cpp index a913feed..8ae062ae 100644 --- a/wled00/util.cpp +++ b/wled00/util.cpp @@ -342,10 +342,7 @@ uint8_t extractModeSlider(uint8_t mode, uint8_t slider, char *dest, uint8_t maxL } else { // WLEDMM bugfix for WLED-MM #272 // names.substring(...).c_str() returns a pointer to a temporary; it’s invalid by the next statement. Added result buffer "sub" to avoid use-after-free - // if (nameEnd<0) tmpstr = names.substring(nameBegin).c_str(); // did not find ",", last name? - // else tmpstr = names.substring(nameBegin, nameEnd).c_str(); - // strlcpy(dest, tmpstr, maxLen); // copy the name into buffer (replacing previous) - String sub = (nameEnd<0) ? names.substring(nameBegin) : names.substring(nameBegin, nameEnd); + String sub = (nameEnd<0) ? names.substring(nameBegin) : names.substring(nameBegin, nameEnd); // special handling in case we did not find "," (last name) strlcpy(dest, sub.c_str(), maxLen); // copy the name into buffer (replacing previous) } }