mirror of
https://github.com/git/git
synced 2024-08-28 20:20:07 +00:00
Use strchrnul() instead of strchr() plus manual workaround
Also gets rid of a C++ comment. Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
This commit is contained in:
parent
175a494823
commit
94e02e7f3b
|
@ -320,9 +320,7 @@ static const char *find_wholine(const char *who, int wholen, const char *buf, un
|
||||||
|
|
||||||
static const char *copy_line(const char *buf)
|
static const char *copy_line(const char *buf)
|
||||||
{
|
{
|
||||||
const char *eol = strchr(buf, '\n');
|
const char *eol = strchrnul(buf, '\n');
|
||||||
if (!eol) // simulate strchrnul()
|
|
||||||
eol = buf + strlen(buf);
|
|
||||||
return xmemdupz(buf, eol - buf);
|
return xmemdupz(buf, eol - buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue