Commit 489c03a8 authored by Sylvain Berfini's avatar Sylvain Berfini 🐮
Browse files

Fix issue with trim function

parent cad62d59
......@@ -853,12 +853,13 @@ const char* sal_privacy_to_string(SalPrivacy privacy) {
}
}
static void remove_trailing_spaces(char *line){
size_t i;
for(i=strlen(line)-1;i>=0;--i){
if (isspace(line[i])) line[i]='\0';
else break;
static void remove_trailing_spaces(char *line) {
size_t size = size = strlen(line);
char *end = line + size - 1;
while (end >= line && isspace(*end)) {
end--;
}
*(end + 1) = '\0';
}
static int line_get_value(const char *input, const char *key, char *value, size_t value_size, size_t *read){
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment