minor bugfixes as suggested by the rabbit
- PulLightControl UM: dont release a lock you do not own - off-by-one error in extractModeSlider (used only in rotary in UM) - safety check in playlist in case something goes horribly wrong
This commit is contained in:
@@ -89,7 +89,8 @@ int16_t loadPlaylist(JsonObject playlistObj, byte presetId) {
|
||||
it++;
|
||||
}
|
||||
}
|
||||
for (int i = it; i < playlistLen; i++) playlistEntries[i].dur = playlistEntries[it -1].dur;
|
||||
if (it > 0) // should never happen but just in case
|
||||
for (int i = it; i < playlistLen; i++) playlistEntries[i].dur = playlistEntries[it -1].dur;
|
||||
|
||||
it = 0;
|
||||
JsonArray tr = playlistObj[F("transition")];
|
||||
|
||||
@@ -336,7 +336,7 @@ uint8_t extractModeSlider(uint8_t mode, uint8_t slider, char *dest, uint8_t maxL
|
||||
case 0: strncpy_P(dest, PSTR("FX Speed"), maxLen); break;
|
||||
case 1: strncpy_P(dest, PSTR("FX Intensity"), maxLen); break;
|
||||
}
|
||||
dest[maxLen] = '\0'; // strncpy does not necessarily null terminate string
|
||||
dest[maxLen-1] = '\0'; // strncpy does not necessarily null terminate string
|
||||
}
|
||||
}
|
||||
return strlen(dest);
|
||||
|
||||
Reference in New Issue
Block a user