From d773b73e451321b35a8d8577bb711da587f3fed6 Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Tue, 31 Mar 2015 23:22:37 +0200 Subject: [PATCH] don't divide by zero on empty results folder --- top1m/parse_results.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/top1m/parse_results.py b/top1m/parse_results.py index 4790fe4..a44a237 100644 --- a/top1m/parse_results.py +++ b/top1m/parse_results.py @@ -617,6 +617,8 @@ for stat in sorted(keysize): percent = round(keysize[stat] / total * 100, 4) sys.stdout.write(stat.ljust(25) + " " + str(keysize[stat]).ljust(10) + str(percent).ljust(9) + "\n") +if total == 0: + total = 1 sys.stdout.write("RSA/ECDSA Dual Stack".ljust(25) + " " + str(dsarsastack).ljust(10) + str(round(dsarsastack/total * 100, 4)) + "\n") print("\nOCSP stapling Count Percent ")