summaryrefslogtreecommitdiff
path: root/src/commit.c
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2016-02-11 22:19:20 +0100
committerCarlos Martín Nieto <cmn@dwim.me>2016-02-11 22:19:20 +0100
commit460ae11f0a8178c5d5abc55574dc3e0e312a47ea (patch)
tree92d892c9a2741fe5bc4315865b60a91a095e7e36 /src/commit.c
parent66ce08a66ccc955a2214829448bea359dcb38a87 (diff)
downloadlibgit2-460ae11f0a8178c5d5abc55574dc3e0e312a47ea.tar.gz
commit: don't forget the last header field
When we moved the logic to handle the first one, wrong loop logic was kept in place which meant we still finished early. But we now notice it because we're not reading past the last LF we find. This was not noticed before as the last field in the tested commit was multi-line which does not trigger the early break.
Diffstat (limited to 'src/commit.c')
-rw-r--r--src/commit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/commit.c b/src/commit.c
index 453506d2f..8faef07df 100644
--- a/src/commit.c
+++ b/src/commit.c
@@ -568,7 +568,7 @@ int git_commit_header_field(git_buf *out, const git_commit *commit, const char *
git_buf_sanitize(out);
- while ((eol = strchr(buf, '\n')) && eol[1] != '\0') {
+ while ((eol = strchr(buf, '\n'))) {
/* We can skip continuations here */
if (buf[0] == ' ') {
buf = eol + 1;