From 3e5b152718b36865eb867b5a7bbfbd0dd6149b81 Mon Sep 17 00:00:00 2001 From: Blaz Kristan Date: Sat, 23 Jul 2022 22:38:35 +0200 Subject: [PATCH] Fix for palette defaults. --- wled00/util.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wled00/util.cpp b/wled00/util.cpp index 3f542823..de861998 100644 --- a/wled00/util.cpp +++ b/wled00/util.cpp @@ -327,7 +327,9 @@ uint8_t extractModeSlider(uint8_t mode, uint8_t slider, char *dest, uint8_t maxL names = lineBuffer.substring(stop+1); // stop has index of color slot names nameBegin = names.indexOf(';'); // look for palette if (nameBegin >= 0) { + nameEnd = names.indexOf(';', nameBegin+1); if (!isdigit(names[nameBegin+1])) nameBegin = names.indexOf('=', nameBegin+1); // look for default value + if (nameEnd >= 0 && nameBegin > nameEnd) nameBegin = -1; if (nameBegin >= 0 && var) { *var = (uint8_t)atoi(names.substring(nameBegin+1).c_str()); }