summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/til_settings.c3
-rw-r--r--src/til_settings.h3
2 files changed, 3 insertions, 3 deletions
diff --git a/src/til_settings.c b/src/til_settings.c
index 9fce32f..b4da4fd 100644
--- a/src/til_settings.c
+++ b/src/til_settings.c
@@ -52,11 +52,10 @@ static int add_value(til_settings_t *settings, const char *key, const char *valu
settings->num++;
/* TODO errors */
settings->settings = realloc(settings->settings, settings->num * sizeof(til_setting_t *));
- settings->settings[settings->num - 1] = malloc(sizeof(til_setting_t));
+ settings->settings[settings->num - 1] = calloc(1, sizeof(til_setting_t));
settings->settings[settings->num - 1]->key = key;
settings->settings[settings->num - 1]->value = value;
settings->settings[settings->num - 1]->desc = desc;
- settings->settings[settings->num - 1]->user_data = NULL;
return 0;
}
diff --git a/src/til_settings.h b/src/til_settings.h
index 93c0ed8..d4822be 100644
--- a/src/til_settings.h
+++ b/src/til_settings.h
@@ -25,8 +25,9 @@ typedef struct til_setting_desc_generator_t {
int (*func)(til_setup_t *setup_context, const til_setting_desc_t **res_desc);
} til_setting_desc_generator_t;
-/* Encapsulates a single til_settings_t entry */
+/* Encapsulates a single til_settings_t.settings[] entry */
struct til_setting_t {
+ til_settings_t *value_as_nested_settings; /* XXX: non-NULL when setup turned this setting's value into a nested settings instance */
const char *key;
const char *value;
const til_setting_desc_t *desc;
© All Rights Reserved