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: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
9c9b03b1f1
commit
263434f20c
4
attr.c
4
attr.c
@ -402,8 +402,8 @@ static struct attr_stack *read_attr_from_index(const char *path, int macro_ok)
|
|||||||
for (sp = buf; *sp; ) {
|
for (sp = buf; *sp; ) {
|
||||||
char *ep;
|
char *ep;
|
||||||
int more;
|
int more;
|
||||||
for (ep = sp; *ep && *ep != '\n'; ep++)
|
|
||||||
;
|
ep = strchrnul(sp, '\n');
|
||||||
more = (*ep == '\n');
|
more = (*ep == '\n');
|
||||||
*ep = '\0';
|
*ep = '\0';
|
||||||
handle_attr_line(res, sp, path, ++lineno, macro_ok);
|
handle_attr_line(res, sp, path, ++lineno, macro_ok);
|
||||||
|
Loading…
Reference in New Issue
Block a user