diff options
Diffstat (limited to 'builtin-rev-list.c')
-rw-r--r-- | builtin-rev-list.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin-rev-list.c b/builtin-rev-list.c index 1cb5f67119..de80158fd4 100644 --- a/builtin-rev-list.c +++ b/builtin-rev-list.c @@ -520,7 +520,7 @@ static void read_revisions_from_stdin(struct rev_info *revs) while (fgets(line, sizeof(line), stdin) != NULL) { int len = strlen(line); - if (line[len - 1] == '\n') + if (len && line[len - 1] == '\n') line[--len] = 0; if (!len) break; |