Merge branch 'cb/array-size' into maint
[gitweb.git] / line-range.c
index ede0c6c98f7b6fc1f4e85a3956f7824a81dff743..de4e32f9424fbc0770756c3f61751fc69bfeb17e 100644 (file)
@@ -54,8 +54,11 @@ static const char *parse_loc(const char *spec, nth_line_fn_t nth_line,
        }
        num = strtol(spec, &term, 10);
        if (term != spec) {
-               if (ret)
+               if (ret) {
+                       if (num <= 0)
+                               die("-L invalid line number: %ld", num);
                        *ret = num;
+               }
                return term;
        }