{"thread":{"id":"42331","subject":"[PATCH] attr.c: use strchrnul() to scan for one line","startedAt":"2016-05-15T22:28:10Z","lastAt":"2016-05-15T22:28:10Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"286612","messageId":"xmqqr3d33qit.fsf@gitster.mtv.corp.google.com","threadId":"42331","inReplyTo":null,"subject":"[PATCH] attr.c: use strchrnul() to scan for one line","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-05-15T22:28:10Z","receivedAt":"2016-05-15T22:28:10Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n attr.c | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/attr.c b/attr.c\nindex a19946a..a7f2c3f 100644\n--- a/attr.c\n+++ b/attr.c\n@@ -407,8 +407,8 @@ static struct attr_stack *read_attr_from_index(const char *path, int macro_ok)\n \tfor (sp = buf; *sp; ) {\n \t\tchar *ep;\n \t\tint more;\n-\t\tfor (ep = sp; *ep && *ep != '\\n'; ep++)\n-\t\t\t;\n+\n+\t\tep = strchrnul(sp, '\\n');\n \t\tmore = (*ep == '\\n');\n \t\t*ep = '\\0';\n \t\thandle_attr_line(res, sp, path, ++lineno, macro_ok);\n-- \n2.8.2-748-gfb85f76\n"}]}