Parcourir la source

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

Gian Miguel Del Mundo il y a 2 ans
Parent
commit
8976539177
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  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:]