summaryrefslogtreecommitdiffstats
path: root/usr.bin/locate
diff options
context:
space:
mode:
authorwosch <wosch@FreeBSD.org>1997-09-23 12:47:47 +0000
committerwosch <wosch@FreeBSD.org>1997-09-23 12:47:47 +0000
commit6947e679d60fb9e0b52ea1af350dc6af641dde8a (patch)
tree779d9e857c7c86ae8ed6c97dc9ec6e03939fe9f9 /usr.bin/locate
parent163624b75f4d2aa5c1d1ea3988fddaeba48b9fac (diff)
downloadFreeBSD-src-6947e679d60fb9e0b52ea1af350dc6af641dde8a.zip
FreeBSD-src-6947e679d60fb9e0b52ea1af350dc6af641dde8a.tar.gz
Float overflow in statistic function for large databases
(>100MB characters).
Diffstat (limited to 'usr.bin/locate')
-rw-r--r--usr.bin/locate/locate/fastfind.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/locate/locate/fastfind.c b/usr.bin/locate/locate/fastfind.c
index 8a46b0f..d886ffa 100644
--- a/usr.bin/locate/locate/fastfind.c
+++ b/usr.bin/locate/locate/fastfind.c
@@ -34,7 +34,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: fastfind.c,v 1.9 1997/02/22 19:55:45 peter Exp $
+ * $Id: fastfind.c,v 1.10 1997/07/21 12:08:13 charnier Exp $
*/
@@ -89,10 +89,10 @@ statistic (fp, path_fcodes)
(void)printf("\nDatabase: %s\n", path_fcodes);
(void)printf("Compression: Front: %2.2f%%, ",
- (float)(100 * (size + big - (2 * NBG))) / chars);
- (void)printf("Bigram: %2.2f%%, ", (float)(100 * (size - big)) / size);
+ (size + big - (2 * NBG)) / (chars / (float)100));
+ (void)printf("Bigram: %2.2f%%, ", (size - big) / (size / (float)100));
(void)printf("Total: %2.2f%%\n",
- (float)(100 * (size - (2 * NBG))) / chars);
+ (size - (2 * NBG)) / (chars / (float)100));
(void)printf("Filenames: %d, ", lines);
(void)printf("Characters: %d, ", chars);
(void)printf("Database size: %d\n", size);
OpenPOWER on IntegriCloud