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:
@@ -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++;
|
||||
|
||||
Reference in New Issue
Block a user