From 304225c9bda8c9c980442bdf82e5b48ec4ec0c38 Mon Sep 17 00:00:00 2001 From: "David A. Wheeler" Date: Tue, 29 Jul 2014 08:43:27 -0400 Subject: [PATCH] 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. --- flawfinder | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/flawfinder b/flawfinder index 3029099..a7a8ebc 100755 --- a/flawfinder +++ b/flawfinder @@ -1,5 +1,7 @@ #!/usr/bin/env python +from __future__ import division + """flawfinder: Find potential security flaws ("hits") in source code. Usage: flawfinder [options] [source_code_file]+ @@ -35,7 +37,6 @@ version="1.31" # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - import sys, re, string, getopt import pickle # To support load/save/diff of hitlist 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. print "in approximately %.2f seconds (%.0f lines/second)" % ( time_analyzing, - (sumlines * 1.0 / time_analyzing) ) + (sumlines / time_analyzing) ) else: print if output_format: print "
"