From 460ae11f0a8178c5d5abc55574dc3e0e312a47ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Thu, 11 Feb 2016 22:19:20 +0100 Subject: 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. --- src/commit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/commit.c') 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; -- cgit v1.2.1