diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-05-15 15:21:57 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-05-16 13:55:02 -0700 |
commit | c69fa1906ea51191d2e13ae4d9136c66c1291a36 (patch) | |
tree | 8d82496c89cc332da2a00d1ac39cc39061f40560 | |
parent | 37678bee95adaf4250f2b6d99c6cbaad6f87586c (diff) | |
download | git-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.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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); |