From: Junio C Hamano Date: Sat, 28 Jan 2017 02:01:41 +0000 (-0800) Subject: commit.c: use strchrnul() to scan for one line X-Git-Tag: v2.13.0-rc0~169^2~26 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/9c9b03b1f1fa84f4a723aac962e1126d27de4a4f?ds=sidebyside commit.c: use strchrnul() to scan for one line Signed-off-by: Junio C Hamano Signed-off-by: Stefan Beller Signed-off-by: Brandon Williams Signed-off-by: Junio C Hamano --- diff --git a/commit.c b/commit.c index 2cf85158b4..0c4ee3de42 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;