From 7163d50ce6e5deaefaa32f9a6d0bbcc778fcb24b Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 1 Sep 2013 23:14:31 +0200 Subject: [db] intercept possible division by zero --- luaotfload-database.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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, -- cgit v1.2.3