Skip to content

Commit

Permalink
Traditionally empty string in config is represented as NULL
Browse files Browse the repository at this point in the history
  • Loading branch information
rojer committed Apr 27, 2021
1 parent 8c0c40a commit 2e2c26f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/mgos_config_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,10 @@ bool mgos_conf_copy_str(const char *s, const char **copy) {
*copy = (char *) s;
return true;
}
if (*s == '\0') {
*copy = NULL;
return true;
}
*copy = strdup(s);
return (*copy != NULL);
}
Expand Down

0 comments on commit 2e2c26f

Please sign in to comment.