Skip to content

Commit eb2552d

Browse files
authored
Using strcmp in mgos_config_is_default_str
This PR fix for this issue - ``` cesanta#568 ``` Compare with == not always right way. Need using strcmp.
1 parent 12db6d0 commit eb2552d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/mgos_gen_config.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ def GetSourceLines(self):
710710
bool {name}_is_default_str(const char *s) {{
711711
int num_str = (sizeof({stn}) / sizeof({stn}[0]));
712712
for (int i = 0; i < num_str; i++) {{
713-
if ({stn}[i] == s) return true;
713+
if (strcmp({stn}[i],s) == 0) return true;
714714
}}
715715
return false;
716716
}}""".format(name=self._struct_name, stn=stn))

0 commit comments

Comments
 (0)