소스 검색

Fixed lineEnd indexing if the match is the whole line (#1223)

Gian Miguel Del Mundo 2 년 전
부모
커밋
8976539177
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      detect/utils.go

+ 1 - 1
detect/utils.go

@@ -130,7 +130,7 @@ func printFinding(f report.Finding, noColor bool) {
 
 		lineEndIdx := matchInLineIDX + len(f.Match)
 		if len(f.Line)-1 <= lineEndIdx {
-			lineEndIdx = len(f.Line) - 1
+			lineEndIdx = len(f.Line)
 		}
 
 		lineEnd := f.Line[lineEndIdx:]