From 809773474d2590fbace4eed3f6377c75d3d11589 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Mon, 12 Aug 2024 12:10:11 -0400 Subject: bugfix: use strtof in INIVAL_TYPE_FLOAT case * Include stdio.h to pull in FILE structure --- src/ini.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/ini.c b/src/ini.c index dfbd817..42891ef 100644 --- a/src/ini.c +++ b/src/ini.c @@ -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; -- cgit