longer segment names

* introducing WLED_MAX_SEGNAME_LEN from upstream
* default: max name length = 48
* hopefully found all places where the segment name length was hardcoded (32, 33, 34)
* some comments still refer to "32" but wtf
This commit is contained in:
Frank
2025-11-20 23:49:26 +01:00
parent dcdc05b592
commit e63dc7e71e
6 changed files with 31 additions and 25 deletions

View File

@@ -151,8 +151,8 @@ bool deserializeSegment(JsonObject elem, byte it, byte presetId)
if (name != nullptr) len = strlen(name);
if (len > 0) {
// WLEDMM: truncate segment name, instead of silently deleting
if (len > 32) { // ToDO: use WLED_MAX_SEGNAME_LEN
len = 32; // cut to max segment name length
if (len > WLED_MAX_SEGNAME_LEN) {
len = WLED_MAX_SEGNAME_LEN; // cut to max segment name length
#if defined(WLED_ENABLE_FULL_FONTS)
if (name[len] > 127) // UTF-8 => don't cut in the middle of a multi-byte char
len = cutUnicodeAt((unsigned char*)name, len-1) +1; // +1 to convert between index and length