diff --git a/builtin-for-each-ref.c b/builtin-for-each-ref.c
index e909e66bedb168b7d10f6f0c3cd806d6ce139a2c..bfde2e2bbeffaed68b369b25cfe1b5ef4b108e12 100644 (file)
--- a/builtin-for-each-ref.c
+++ b/builtin-for-each-ref.c
@@ -304,7 +304,7 @@ static const char *find_wholine(const char *who, int wholen, const char *buf, un
if (!eol)
return "";
eol++;
- if (eol[1] == '\n')
+ if (*eol == '\n')
return ""; /* end of header */
buf = eol;
}