aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/core/ini.c10
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;
}