Thread (93 messages) 93 messages, 2 authors, 2017-01-30

[PATCH v3 01/27] commit.c: use strchrnul() to scan for one line

STALE3535d

From: Brandon Williams <hidden>
Date: 2017-01-28 02:02:37
Subsystem: the rest · Maintainer: Linus Torvalds

Revision v3 of 3 in this series.

Revisions (3)
  1. v1 [diff vs current]
  2. v2 [diff vs current]
  3. v3 current
From: Junio C Hamano <redacted>

Signed-off-by: Junio C Hamano <redacted>
Signed-off-by: Stefan Beller <redacted>
Signed-off-by: Brandon Williams <redacted>
---
 commit.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/commit.c b/commit.c
index 2cf85158b..0c4ee3de4 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;
 
-- 
2.11.0.483.g087da7b7c-goog
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help