mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2025-12-09 23:34:38 +01:00
Fix string handling
This commit is contained in:
parent
42d1e14a91
commit
97320a95ab
1 changed files with 8 additions and 3 deletions
|
|
@ -317,13 +317,18 @@ void free_dmmap_config_dup_list(struct list_head *dup_list)
|
|||
|
||||
struct uci_section *get_config_section_from_dmmap_section_name(const char *config_sec_name)
|
||||
{
|
||||
if (DM_STRLEN(config_sec_name) == 0)
|
||||
int len = DM_STRLEN(config_sec_name);
|
||||
|
||||
if (len == 0)
|
||||
return NULL;
|
||||
|
||||
char *p = strchr(config_sec_name, '.');
|
||||
char tmp[len + 1];
|
||||
snprintf(tmp, sizeof(tmp), "%s", config_sec_name);
|
||||
|
||||
char *p = strchr(tmp, '.');
|
||||
if (p) *p = 0;
|
||||
|
||||
return dmuci_get_section(config_sec_name, p ? p + 1 : "");
|
||||
return dmuci_get_section(tmp, p ? p + 1 : "");
|
||||
}
|
||||
|
||||
struct uci_section *get_origin_section_from_config(const char *package, const char *section_type, const char *orig_section_name)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue