Removing of sets fixed

This commit is contained in:
Jens Noack 2020-12-15 11:04:41 +01:00
parent 19a3601581
commit f42a16a11c

View file

@ -329,15 +329,19 @@ LedDisplayController::GetSetTextSetParameterExitCode LedDisplayController::getSe
case TextParameter:
if (set)
{
if (*value == "")
if (*value == "") {
// delete the index
Serial.println("Deleting: " + String(index));
for (int i = index; i < this->maximumTextSets; i++)
{
if (i > this->maximumTextSets - 1)
if (i < this->maximumTextSets - 1)
this->text_sets.sets[i] = this->text_sets.sets[i + 1];
else
this->text_sets.sets[i] = this->defaultTextSet;
}
}
else
strncpy(currentTextSet->text, value->c_str(), sizeof(currentTextSet->text));
}