diff --git a/wled00/data/index.js b/wled00/data/index.js index 5d08a3f8..a1b564ec 100644 --- a/wled00/data/index.js +++ b/wled00/data/index.js @@ -827,7 +827,7 @@ function populateSegments(s) (cfg.comp.segpwr ? segp : '') + `
| ${isMSeg?'Start X':'Start LED'} | `+ diff --git a/wled00/file.cpp b/wled00/file.cpp index 5a82bdb3..bb853df9 100644 --- a/wled00/file.cpp +++ b/wled00/file.cpp @@ -214,7 +214,7 @@ bool appendObjectToFile(const char* key, JsonDocument* content, uint32_t s, uint if (!f) return false; if (f.size() < 3) { - char init[10]; + char init[12]; strcpy_P(init, PSTR("{\"0\":{}}")); f.print(init); } @@ -285,7 +285,7 @@ bool appendObjectToFile(const char* key, JsonDocument* content, uint32_t s, uint bool writeObjectToFileUsingId(const char* file, uint16_t id, JsonDocument* content) { - char objKey[10]; + char objKey[12]; sprintf(objKey, "\"%d\":", id); return writeObjectToFile(file, objKey, content); } @@ -360,7 +360,7 @@ bool writeObjectToFile(const char* file, const char* key, JsonDocument* content) bool readObjectFromFileUsingId(const char* file, uint16_t id, JsonDocument* dest) { - char objKey[10]; + char objKey[12]; sprintf(objKey, "\"%d\":", id); return readObjectFromFile(file, objKey, dest); } diff --git a/wled00/presets.cpp b/wled00/presets.cpp index 3e5b4142..b8d121d0 100644 --- a/wled00/presets.cpp +++ b/wled00/presets.cpp @@ -12,7 +12,7 @@ static volatile byte presetToApply = 0; static volatile byte callModeToApply = 0; static volatile byte presetToSave = 0; static volatile int8_t saveLedmap = -1; -static char quickLoad[9]; +static char quickLoad[12]; // WLEDMM 9->12 to prevent crashing with unicode static char saveName[33]; static bool includeBri = true, segBounds = true, selectedOnly = false, playlistSave = false; @@ -88,8 +88,8 @@ static void doSaveState() { // clean up saveLedmap = -1; presetToSave = 0; - saveName[0] = '\0'; - quickLoad[0] = '\0'; + memset(saveName, '\0', sizeof(saveName)); + memset(quickLoad,'\0', sizeof(quickLoad)); playlistSave = false; } @@ -306,7 +306,7 @@ void savePreset(byte index, const char* pname, JsonObject sObj) presetToSave = index; playlistSave = false; - if (sObj[F("ql")].is