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

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

flat view
STALE3541d SUPERSEDED

From: Brandon Williams <hidden>
Date: 2017-01-13 00:00:45
Subsystem: the rest · Maintainer: Linus Torvalds

Revision v1 of 3 in this series.

Revisions (3)
  1. v1 current
  2. v2 [diff vs current]
  3. v3 [diff vs 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>
---
 attr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/attr.c b/attr.c
index 1fcf042b8..04d24334e 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.11.0.390.gc69c2f50cf-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