benchmarks/eina: fix possible div by zero in ecore_hash
authorMike Blumenkrantz <zmike@samsung.com>
Fri, 18 Oct 2019 17:29:07 +0000 (13:29 -0400)
committerWonki Kim <wonki_.kim@samsung.com>
Mon, 11 Nov 2019 02:18:26 +0000 (11:18 +0900)
Summary: CID 1400768

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10397

src/benchmarks/eina/ecore_hash.c

index 76a5ad2..ae9befa 100644 (file)
@@ -416,6 +416,7 @@ ecore_hash_dump_stats(Ecore_Hash *hash)
    unsigned int i;
    double variance, sum_n_2 = 0, sum_n = 0;
 
+   if (!hash->size) return;
    for (i = 0; i < ecore_prime_table[hash->size]; i++)
      {
         if (hash->buckets[i])