Commit 79a34396 by Sebastian Schuberth

Fix a bug and GCC warning introduced in 932669b8

For unsigned types, the comparison >= 0 is always true, so avoid it by using
a post-decrement and integrating the initial assigment into the loop body.
No change in behavior is intended.
parent bac47f1f
......@@ -553,10 +553,8 @@ static char *cfg_readline(diskfile_backend *cfg)
memcpy(line, line_src, line_len);
line[line_len] = '\0';
while (--line_len >= 0 && isspace(line[line_len]))
line[line_len] = '\0';
do line[line_len] = '\0';
while (line_len-- > 0 && isspace(line[line_len]));
if (*line_end == '\n')
line_end++;
......
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