Skip to content

Commit

Permalink
fix(radio): Use SWRC_NONE if switch cannot be found (#4005)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelcoeffic authored Sep 21, 2023
1 parent 661de78 commit 4d148e5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions radio/src/storage/yaml/yaml_datastructs_funcs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,7 @@ static uint32_t r_swtchSrc(const YamlNode* node, const char* val, uint8_t val_le
&& val[3] >= '0' && val[3] <= '2') {

ival = switchLookupIdx(val, val_len - 1) * 3;
if (ival < 0) return SWSRC_NONE;
ival += yaml_str2int(val + 3, val_len - 2);
ival += SWSRC_FIRST_SWITCH;

Expand All @@ -853,6 +854,7 @@ static uint32_t r_swtchSrc(const YamlNode* node, const char* val, uint8_t val_le
&& val[2] >= '0' && val[2] <= '2') {

ival = switchLookupIdx(val, val_len - 1) * 3;
if (ival < 0) return SWSRC_NONE;
ival += yaml_str2int(val + 2, val_len - 2);
ival += SWSRC_FIRST_SWITCH;

Expand Down

0 comments on commit 4d148e5

Please sign in to comment.