Thread (43 messages) flat view 43 messages, 4 authors, 2016-11-09

[PATCHv2 01/36] commit.c: use strchrnul() to scan for one line

From: Stefan Beller <hidden>
Date: 2016-10-28 18:55:26
Subsystem: the rest · Maintainer: Linus Torvalds

From: Junio C Hamano <redacted>

Signed-off-by: Junio C Hamano <redacted>
Signed-off-by: Stefan Beller <redacted>
---
 commit.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/commit.c b/commit.c
index 856fd4aeef..41b2fdd335 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.10.1.714.ge3da0db
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help