Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'builtin-for-each-ref.c')
-rw-r--r--builtin-for-each-ref.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/builtin-for-each-ref.c b/builtin-for-each-ref.c
index e59bd8075e..fa6c1ed752 100644
--- a/builtin-for-each-ref.c
+++ b/builtin-for-each-ref.c
@@ -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)
{
- const char *eol = strchr(buf, '\n');
- if (!eol) // simulate strchrnul()
- eol = buf + strlen(buf);
+ const char *eol = strchrnul(buf, '\n');
return xmemdupz(buf, eol - buf);
}