summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-05-15 15:21:57 -0700
committerJunio C Hamano <gitster@pobox.com>2016-05-16 13:55:02 -0700
commitc69fa1906ea51191d2e13ae4d9136c66c1291a36 (patch)
tree8d82496c89cc332da2a00d1ac39cc39061f40560
parent37678bee95adaf4250f2b6d99c6cbaad6f87586c (diff)
downloadgit-c69fa1906ea51191d2e13ae4d9136c66c1291a36.tar.gz
attr.c: use strchrnul() to scan for one line
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--attr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/attr.c b/attr.c
index eec5d7d15a..45aec1b136 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);