summaryrefslogtreecommitdiff
path: root/src/commit.c
diff options
context:
space:
mode:
authorCarlos Martín Nieto <carlosmn@github.com>2016-03-17 10:45:22 +0100
committerCarlos Martín Nieto <carlosmn@github.com>2016-03-17 10:48:06 +0100
commitbf804d407e8d1fcff42e1113aa286270ae8925c0 (patch)
treec646b98e4b080a8ef3c212072159ae8ac07b863f /src/commit.c
parentde143efa88f6916af62cc5ed172e9cae4b194ae1 (diff)
downloadlibgit2-cmn/extract-oneline-sig.tar.gz
commit: fix extraction of single-line signaturescmn/extract-oneline-sig
The function to extract signatures suffers from a similar bug to the header field finding one by having an unecessary line feed check as a break condition of its loop. Fix that and add a test for this single-line signature situation.
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 9d675ac97..905407aac 100644
--- a/src/commit.c
+++ b/src/commit.c
@@ -726,7 +726,7 @@ int git_commit_extract_signature(git_buf *signature, git_buf *signed_data, git_r
buf = git_odb_object_data(obj);
- while ((h = strchr(buf, '\n')) && h[1] != '\0' && h[1] != '\n') {
+ while ((h = strchr(buf, '\n')) && h[1] != '\0') {
h++;
if (git__prefixcmp(buf, field)) {
if (git_buf_put(signed_data, buf, h - buf) < 0)