diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-10-28 11:54:28 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-10-28 14:40:16 -0700 |
commit | 3cd02906fcdd99fbd37dcaa4053422b44ba4ec41 (patch) | |
tree | 29f9038d88a8136144318e3b3f5d32d05f9a0e9b | |
parent | bc7a724f3151253025bcf59b7978d2385b93a86d (diff) | |
download | git-3cd02906fcdd99fbd37dcaa4053422b44ba4ec41.tar.gz |
attr.c: use strchrnul() to scan for one line
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
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); |