Use non-integer division (requires Python 2.2+)
- Add "from __future__ import division". This is the default in Python 3, and has been long available in Python 2.
This commit is contained in:
parent
7e655111a9
commit
304225c9bd
|
@ -1,5 +1,7 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
from __future__ import division
|
||||||
|
|
||||||
"""flawfinder: Find potential security flaws ("hits") in source code.
|
"""flawfinder: Find potential security flaws ("hits") in source code.
|
||||||
Usage:
|
Usage:
|
||||||
flawfinder [options] [source_code_file]+
|
flawfinder [options] [source_code_file]+
|
||||||
|
@ -35,7 +37,6 @@ version="1.31"
|
||||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import sys, re, string, getopt
|
import sys, re, string, getopt
|
||||||
import pickle # To support load/save/diff of hitlist
|
import pickle # To support load/save/diff of hitlist
|
||||||
import os, glob, operator # To support filename expansion on Windows
|
import os, glob, operator # To support filename expansion on Windows
|
||||||
|
@ -1845,7 +1846,7 @@ def show_final_results():
|
||||||
if time_analyzing > 0 and not omit_time: # Avoid divide-by-zero.
|
if time_analyzing > 0 and not omit_time: # Avoid divide-by-zero.
|
||||||
print "in approximately %.2f seconds (%.0f lines/second)" % (
|
print "in approximately %.2f seconds (%.0f lines/second)" % (
|
||||||
time_analyzing,
|
time_analyzing,
|
||||||
(sumlines * 1.0 / time_analyzing) )
|
(sumlines / time_analyzing) )
|
||||||
else:
|
else:
|
||||||
print
|
print
|
||||||
if output_format: print "<br>"
|
if output_format: print "<br>"
|
||||||
|
|
Loading…
Reference in New Issue