Code

Merge branch 'ag/blame-encoding'
[git.git] / builtin-for-each-ref.c
index e59bd8075e44a8de23503a8a59c5fdd2575a9243..fa6c1ed75285649943e0e62ee0b66ef146dda517 100644 (file)
@@ -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);
 }