Skip to content

Commit

Permalink
Using strcmp in mgos_config_is_default_str
Browse files Browse the repository at this point in the history
This PR fix for this issue - 
```
cesanta#568
```
Compare with == not always right way. Need using strcmp.
  • Loading branch information
Sekilsgs2 authored Feb 18, 2021
1 parent 12db6d0 commit eb2552d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/mgos_gen_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ def GetSourceLines(self):
bool {name}_is_default_str(const char *s) {{
int num_str = (sizeof({stn}) / sizeof({stn}[0]));
for (int i = 0; i < num_str; i++) {{
if ({stn}[i] == s) return true;
if (strcmp({stn}[i],s) == 0) return true;
}}
return false;
}}""".format(name=self._struct_name, stn=stn))
Expand Down

0 comments on commit eb2552d

Please sign in to comment.