Merge pull request #392 from sschuberth/development Fix a bug and GCC warning introduced in 932669b
diff --git a/src/config_file.c b/src/config_file.c
index f7e6f61..3804f97 100644
--- a/src/config_file.c
+++ b/src/config_file.c
@@ -535,10 +535,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++;