diff --git a/flawfinder b/flawfinder index f0ba461..9d370c0 100755 --- a/flawfinder +++ b/flawfinder @@ -1300,7 +1300,10 @@ def process_c_file(f, patch_infos): if m: i = m.end(0) - c = text[i] + if i >= len(text): + c = '' + else: + c = text[i] if linebegin: # If at beginning of line, see if #include is there. linebegin = 0 if c == "#": codeinline = 1 # A directive, count as code. @@ -1436,9 +1439,9 @@ def display_header(): print "