Merge branch 'maint-1.5.6' into maint-1.6.0
[git.git] / builtin-for-each-ref.c
index 21e92bbcb577c0361df51bd81e6fb5ab546619ea..72c087840c39bc03b142ba620f94800d40264eb9 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)
-               return "";
+       const char *eol = strchrnul(buf, '\n');
        return xmemdupz(buf, eol - buf);
 }