diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/delivery.c | 2 | ||||
-rw-r--r-- | src/ini.c | 3 | ||||
-rw-r--r-- | src/strlist.c | 3 |
3 files changed, 4 insertions, 4 deletions
diff --git a/src/delivery.c b/src/delivery.c index eaa2b06..2b5e781 100644 --- a/src/delivery.c +++ b/src/delivery.c @@ -607,7 +607,7 @@ static int populate_delivery_ini(struct Delivery *ctx, int render_mode) { return 0; } -static int populate_delivery_cfg(struct Delivery *ctx, int render_mode) { +int populate_delivery_cfg(struct Delivery *ctx, int render_mode) { struct INIFILE *cfg = ctx->_stasis_ini_fp.cfg; if (!cfg) { return -1; @@ -170,7 +170,7 @@ int ini_getval(struct INIFILE *ini, char *section_name, char *key, int type, int result->as_double = (double) strtod(data_copy, NULL); break; case INIVAL_TYPE_FLOAT: - result->as_float = (float) strtod(data_copy, NULL); + result->as_float = strtof(data_copy, NULL); break; case INIVAL_TYPE_STR: result->as_char_p = strdup(data_copy); @@ -638,7 +638,6 @@ struct INIFILE *ini_open(const char *filename) { } if (isempty(value)) { //printf("%s is probably long raw data\n", key); - //ini_data_set_hint(&ini, current_section, key, INIVAL_TYPE_STR_ARRAY); hint = INIVAL_TYPE_STR_ARRAY; multiline_data = 1; no_data = 1; diff --git a/src/strlist.c b/src/strlist.c index d1bb926..de76744 100644 --- a/src/strlist.c +++ b/src/strlist.c @@ -315,11 +315,12 @@ size_t strlist_count(struct StrList *pStrList) { void strlist_set(struct StrList **pStrList, size_t index, char *value) { char *tmp = NULL; if (*pStrList == NULL || index > strlist_count(*pStrList)) { + strlist_errno = STRLIST_E_OUT_OF_RANGE; return; } if (value == NULL) { - (*pStrList)->data[index] = NULL; + guard_free((*pStrList)->data[index]); } else { tmp = realloc((*pStrList)->data[index], (strlen(value) + 1) * sizeof(char *)); if (!tmp) { |