summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-01-28 02:01:41 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-02-01 21:46:51 (GMT)
commit9c9b03b1f1fa84f4a723aac962e1126d27de4a4f (patch)
tree1cfd2717442066b3f094ee35b095d64ac2c5eb43
parentd7dffce1cebde29a0c4b309a79e4345450bf352a (diff)
downloadgit-9c9b03b1f1fa84f4a723aac962e1126d27de4a4f.zip
git-9c9b03b1f1fa84f4a723aac962e1126d27de4a4f.tar.gz
git-9c9b03b1f1fa84f4a723aac962e1126d27de4a4f.tar.bz2
commit.c: use strchrnul() to scan for one line
Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--commit.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/commit.c b/commit.c
index 2cf8515..0c4ee3d 100644
--- a/commit.c
+++ b/commit.c
@@ -415,8 +415,7 @@ int find_commit_subject(const char *commit_buffer, const char **subject)
p++;
if (*p) {
p = skip_blank_lines(p + 2);
- for (eol = p; *eol && *eol != '\n'; eol++)
- ; /* do nothing */
+ eol = strchrnul(p, '\n');
} else
eol = p;