diff options
Diffstat (limited to 'common/config-parser.c')
-rw-r--r-- | common/config-parser.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/common/config-parser.c b/common/config-parser.c index 36c8ba9..c096104 100644 --- a/common/config-parser.c +++ b/common/config-parser.c @@ -66,10 +66,10 @@ static char* read_config_file(const char** configfile, void* data) { char* config = NULL; - char* newfilename; + char* newfilename; FILE* f = NULL; long len; - int flen; + int flen; ASSERT(configfile); @@ -87,7 +87,7 @@ read_config_file(const char** configfile, void* data) return NULL; } - flen = strlen(*configfile); + flen = strlen(*configfile); if((config = (char*)malloc(len + 4 + flen)) == NULL) { errmsg(*configfile, data, "out of memory"); @@ -110,9 +110,9 @@ read_config_file(const char** configfile, void* data) /* Remove nasty dos line endings */ strcln(config, '\r'); - /* Persistent allocation for filename */ - newfilename = config + len + 2; - strcpy(newfilename, *configfile); + /* Persistent allocation for filename */ + newfilename = config + len + 2; + strcpy(newfilename, *configfile); *configfile = newfilename; return config; @@ -171,7 +171,7 @@ cfg_parse_file(const char* filename, void* data, char** memory) /* No continuation hand off value if necessary */ if(name && value) { - if(cfg_value(filename, header, name, value, data) == -1) + if(cfg_value(filename, header, name, strtrim(value), data) == -1) goto finally; } @@ -212,7 +212,7 @@ cfg_parse_file(const char* filename, void* data, char** memory) t++; name = strtrim(p); - value = strtrim(t); + value = t; } if(name && value) |