diff --git a/epicardium/modules/config.c b/epicardium/modules/config.c index 8ff11c270c4e9172f83df89327544e29166c4b8d..d4c2b74e0b2fed4915ae2670a8da39b078f6042c 100644 --- a/epicardium/modules/config.c +++ b/epicardium/modules/config.c @@ -146,7 +146,8 @@ static void trim(char *str) // parses one line of the config file static void parse_line(char *line, int line_number, size_t line_offset) { - char *line_start = line; + char *line_start = line; + char *value_start = strchr(line, '=') + 1; trim(line); @@ -190,7 +191,7 @@ static void parse_line(char *line, int line_number, size_t line_offset) return; } - size_t value_offset = value - line_start + line_offset; + size_t value_offset = value_start - line_start + line_offset; add_config_pair(key, value, line_number, value_offset); } @@ -617,7 +618,7 @@ int epic_config_set_string(const char *key, const char *value_in) } } - complex_out: + complex_out: if (fd1 >= 0) { epic_file_close(fd1); } @@ -634,7 +635,7 @@ int epic_config_set_string(const char *key, const char *value_in) } } - out: +out: /* Reload config so the new key or the changed value is available */ load_config();