Skip to content
Snippets Groups Projects
Commit 726f15eb authored by schneider's avatar schneider
Browse files

refact(config): Use iscntrl to trim lines in epic_config_get_string

parent c67972e3
No related branches found
No related tags found
No related merge requests found
...@@ -323,10 +323,11 @@ int epic_config_get_string(const char *key, char *buf, size_t buf_len) ...@@ -323,10 +323,11 @@ int epic_config_get_string(const char *key, char *buf, size_t buf_len)
return -ENOENT; return -ENOENT;
} }
char *eol = strchr(buf, '\n'); char *end = buf;
if (eol) { while (!iscntrl(*end))
*eol = '\0'; end++;
} *end = 0;
trim(buf);
return 0; return 0;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment