fix(yaml): String compare not comparing to full string length (#3215)

The string compare only matched the number of characters found
in the yaml file, so "SLIDER1" matched "SL" on the X9E
This commit is contained in:
Malte Langermann
2023-02-20 11:01:58 +10:00
committed by GitHub
parent 66c0551076
commit c3516b54c1
+2 -1
View File
@@ -45,7 +45,8 @@ uint32_t yaml_parse_enum(const struct YamlIdStr* choices, const char* val, uint8
while (choices->str) {
// we have a match!
if (!strncmp(val, choices->str, val_len))
if( strncmp(val, choices->str, val_len) == 0
&& strlen(choices->str) == val_len)
break;
choices++;