summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVicent Martí <tanoku@gmail.com>2011-09-18 19:52:40 -0700
committerVicent Martí <tanoku@gmail.com>2011-09-18 19:52:40 -0700
commitb6ed727a4570a506473c481a344880f99b4ef64d (patch)
tree8bcfec586f20e558a99e00604540620b781dd375 /src
parent33760f17722d910d0ebb12ed847601da2ca03934 (diff)
parent79a343968a4a91c98fae1afa61cdadc5b573c93d (diff)
downloadlibgit2-b6ed727a4570a506473c481a344880f99b4ef64d.tar.gz
Merge pull request #392 from sschuberth/development
Fix a bug and GCC warning introduced in 932669b
Diffstat (limited to 'src')
-rw-r--r--src/config_file.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/config_file.c b/src/config_file.c
index f7e6f61b4..3804f97c4 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++;