Thread (57 messages) flat view 57 messages, 7 authors, 2016-10-27
STALE3608d

[PATCH 02/36] attr.c: use strchrnul() to scan for one line

From: Stefan Beller <hidden>
Date: 2016-10-22 23:32:45
Subsystem: the rest · Maintainer: Linus Torvalds

From: Junio C Hamano <redacted>

Signed-off-by: Junio C Hamano <redacted>
Signed-off-by: Stefan Beller <redacted>
---
 attr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/attr.c b/attr.c
index eec5d7d..45aec1b 100644
--- a/attr.c
+++ b/attr.c
@@ -402,8 +402,8 @@ static struct attr_stack *read_attr_from_index(const char *path, int macro_ok)
 	for (sp = buf; *sp; ) {
 		char *ep;
 		int more;
-		for (ep = sp; *ep && *ep != '\n'; ep++)
-			;
+
+		ep = strchrnul(sp, '\n');
 		more = (*ep == '\n');
 		*ep = '\0';
 		handle_attr_line(res, sp, path, ++lineno, macro_ok);
-- 
2.10.1.508.g6572022
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help