summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-05-15 15:21:36 -0700
committerJunio C Hamano <gitster@pobox.com>2016-05-16 13:55:02 -0700
commit37678bee95adaf4250f2b6d99c6cbaad6f87586c (patch)
treeb4a4fbe54c33a3efdbfc23a693f164d163fc4507
parentd92347f59fefb95a2d9240c007a44f408c216fa7 (diff)
downloadgit-37678bee95adaf4250f2b6d99c6cbaad6f87586c.tar.gz
commit.c: use strchrnul() to scan for one line
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 3f4f371e5e..1f9ee8a0c9 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 += 2;
- for (eol = p; *eol && *eol != '\n'; eol++)
- ; /* do nothing */
+ eol = strchrnul(p, '\n');
} else
eol = p;