diff options
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/core/ini.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/core/ini.c b/src/lib/core/ini.c index f90cb2b..9c332ca 100644 --- a/src/lib/core/ini.c +++ b/src/lib/core/ini.c @@ -407,13 +407,15 @@ int ini_section_create(struct INIFILE **ini, char *key) { } (*ini)->section = tmp; - (*ini)->section[(*ini)->section_count] = calloc(1, sizeof(*(*ini)->section[0])); - if (!(*ini)->section[(*ini)->section_count]) { + struct INISection **section = &(*ini)->section[(*ini)->section_count]; + //[(*ini)->section_count]; + *section = calloc(1, sizeof(*(*ini)->section[0])); + if (!*section) { return -1; } - (*ini)->section[(*ini)->section_count]->key = strdup(key); - if (!(*ini)->section[(*ini)->section_count]->key) { + (*section)->key = strdup(key); + if (!(*section)->key) { return -1; } |
