summaryrefslogtreecommitdiff
path: root/luaotfload-database.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2013-09-01 23:14:31 +0200
committerPhilipp Gesang <phg42.2a@gmail.com>2013-09-01 23:14:31 +0200
commit7163d50ce6e5deaefaa32f9a6d0bbcc778fcb24b (patch)
treeba6cb7c7d082f0821ec0d6900cca70467817ddf3 /luaotfload-database.lua
parent6c4b470d23faf61e4f9b0aab5f871bf87b6707bb (diff)
downloadluaotfload-7163d50ce6e5deaefaa32f9a6d0bbcc778fcb24b.tar.gz
[db] intercept possible division by zero
Diffstat (limited to 'luaotfload-database.lua')
-rw-r--r--luaotfload-database.lua7
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,