From a1359276f4142d1573c4f2d84c1750da1c922b0a Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Sun, 8 May 2011 00:34:09 +1000 Subject: [PATCH] Fix nan when no hashes found in verbose message. --- rzip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rzip.c b/rzip.c index 8723ea9..fbd564a 100644 --- a/rzip.c +++ b/rzip.c @@ -512,7 +512,7 @@ static void show_distrib(rzip_control *control, struct rzip_state *st) print_err("WARNING: hash_count says total %lld\n", st->hash_count); print_output("%lld total hashes -- %lld in primary bucket (%-2.3f%%)\n", total, primary, - primary*100.0/total); + primary * 100.0 / (total ? : 1)); } static void hash_search(rzip_control *control, struct rzip_state *st, double pct_base, double pct_multiple)