diff options
author | Philipp Gesang <phg42.2a@gmail.com> | 2013-09-01 23:14:31 +0200 |
---|---|---|
committer | Philipp Gesang <phg42.2a@gmail.com> | 2013-09-01 23:14:31 +0200 |
commit | 7163d50ce6e5deaefaa32f9a6d0bbcc778fcb24b (patch) | |
tree | ba6cb7c7d082f0821ec0d6900cca70467817ddf3 /luaotfload-database.lua | |
parent | 6c4b470d23faf61e4f9b0aab5f871bf87b6707bb (diff) | |
download | luaotfload-7163d50ce6e5deaefaa32f9a6d0bbcc778fcb24b.tar.gz |
[db] intercept possible division by zero
Diffstat (limited to 'luaotfload-database.lua')
-rw-r--r-- | luaotfload-database.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/luaotfload-database.lua b/luaotfload-database.lua index e77d4fd..bae90c3 100644 --- a/luaotfload-database.lua +++ b/luaotfload-database.lua @@ -2691,8 +2691,13 @@ local collect_statistics = function (mappings) pprint_top (fontstyle_name, 4) end + local mean_dsnsize = 0 + if n_dsnsize > 0 then + mean_dsnsize = sum_dsnsize / n_dsnsize + end + return { - mean_dsnsize = sum_dsnsize / n_dsnsize, + mean_dsnsize = mean_dsnsize, names = { fullname = n_fullname, families = n_family, |