diff --git a/flawfinder b/flawfinder index 60a2c1a..cee78ee 100755 --- a/flawfinder +++ b/flawfinder @@ -1461,6 +1461,7 @@ def process_c_file(f, patch_infos): linenumber = 1 ignoreline = -1 + cpplanguage = f.endswith(".cpp") or f.endswith(".cxx") or f.endswith(".cc") incomment = 0 instring = 0 linebegin = 1 @@ -1644,9 +1645,12 @@ def process_c_file(f, patch_infos): startpos + max_lookahead] hit.hook(hit) elif p_digits.match(c): - while i < len(text) and p_digits.match( - text[i]): # Process a number. - i += 1 + while i < len(text): # Process a number. + # C does not have digit separator + if p_digits.match(text[i]) or (cpplanguage and text[i] == "'"): + i += 1 + else: + break # else some other character, which we ignore. # End of loop through text. Wrap up. if codeinline: