From f88bd3cbfaa62914adff9076f5d2fd64c08509a7 Mon Sep 17 00:00:00 2001 From: dima Date: Sat, 24 Feb 2024 16:13:47 +0300 Subject: [PATCH] check $lineno valid --- find-file-doc-comments.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/find-file-doc-comments.pl b/find-file-doc-comments.pl index e14028f3..f57cb8a7 100755 --- a/find-file-doc-comments.pl +++ b/find-file-doc-comments.pl @@ -131,7 +131,7 @@ sub main { # Is it actually a header for this function? say " Checking line $lineno for header" if $VERBOSE; - next unless $source_lines[$lineno] =~ $this_doc_comment_header; + next unless $lineno > 0 && $source_lines[$lineno] =~ $this_doc_comment_header; # We have found a header. Confirm it's a doc comment. --$lineno;