X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-blame.c;h=fc1586350f94ae48e7e48a51818517b465e7a40d;hb=34b383e7cd57692fd3996c1e8c9e738dab53ac48;hp=6408ec8ee6805fc42eb5e5dc52be6463d62128bf;hpb=b3ce9a0874cc7ec1d0fd5ead97d78a428d1fdd75;p=git.git diff --git a/builtin-blame.c b/builtin-blame.c index 6408ec8ee..fc1586350 100644 --- a/builtin-blame.c +++ b/builtin-blame.c @@ -1772,7 +1772,7 @@ static int lineno_width(int lines) { int i, width; - for (width = 1, i = 10; i <= lines + 1; width++) + for (width = 1, i = 10; i <= lines; width++) i *= 10; return width; } @@ -2433,7 +2433,7 @@ parse_done: if (top < 1) top = lno; bottom--; - if (lno < top) + if (lno < top || lno < bottom) die("file %s has only %lu lines", path, lno); ent = xcalloc(1, sizeof(*ent));