Fix potential YAML format issue by enclosing "def" value in double quotes

This commit is contained in:
Raphael Coeffic
2021-12-30 13:55:06 +01:00
parent d37b3e4051
commit 587e64f76a
2 changed files with 8 additions and 0 deletions
@@ -840,6 +840,7 @@ bool w_customFn(void* user, uint8_t* data, uint32_t bitoffs,
const char* str = nullptr;
bool add_comma = true;
if (!wf(opaque, "\"", 1)) return false;
switch (func) {
case FUNC_OVERRIDE_CHANNEL:
@@ -973,6 +974,7 @@ bool w_customFn(void* user, uint8_t* data, uint32_t bitoffs,
if (!wf(opaque, str, strlen(str))) return false;
}
}
if (!wf(opaque, "\"", 1)) return false;
return true;
}
@@ -986,6 +988,7 @@ bool w_logicSw(void* user, uint8_t* data, uint32_t bitoffs,
{
data += bitoffs >> 3UL;
data -= sizeof(LogicalSwitchData::func);
if (!wf(opaque,"\"",1)) return false;
const char* str = nullptr;
auto ls = reinterpret_cast<LogicalSwitchData*>(data);
@@ -1037,6 +1040,7 @@ bool w_logicSw(void* user, uint8_t* data, uint32_t bitoffs,
break;
}
if (!wf(opaque,"\"",1)) return false;
return true;
}
@@ -1306,6 +1306,7 @@ static bool w_customFn(void* user, uint8_t* data, uint32_t bitoffs,
const char* str = nullptr;
bool add_comma = true;
if (!wf(opaque, "\"", 1)) return false;
switch (func) {
case FUNC_OVERRIDE_CHANNEL:
@@ -1439,6 +1440,7 @@ static bool w_customFn(void* user, uint8_t* data, uint32_t bitoffs,
if (!wf(opaque, str, strlen(str))) return false;
}
}
if (!wf(opaque, "\"", 1)) return false;
return true;
}
@@ -1531,6 +1533,7 @@ static bool w_logicSw(void* user, uint8_t* data, uint32_t bitoffs,
{
data += bitoffs >> 3UL;
data -= sizeof(LogicalSwitchData::func);
if (!wf(opaque,"\"",1)) return false;
const char* str = nullptr;
auto ls = reinterpret_cast<LogicalSwitchData*>(data);
@@ -1582,6 +1585,7 @@ static bool w_logicSw(void* user, uint8_t* data, uint32_t bitoffs,
break;
}
if (!wf(opaque,"\"",1)) return false;
return true;
}