Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
attr.c: use strchrnul() to scan for one line
author
Junio C Hamano
<gitster@pobox.com>
Sat, 28 Jan 2017 02:01:42 +0000
(18:01 -0800)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 1 Feb 2017 21:46:51 +0000
(13:46 -0800)
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>
attr.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
9c9b03b
)
diff --git
a/attr.c
b/attr.c
index 1fcf042b87c8a39fb967e07c5acb81c0c364d136..04d24334e8fe1824222ed53f2f571aba2ddfe65b 100644
(file)
--- 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);