From ad410a5c933ec6a6aec6645a108b85f2aa906a02 Mon Sep 17 00:00:00 2001 From: Ryan Luchs Date: Sat, 6 Jul 2019 17:44:58 -0400 Subject: removed potential division by zero with size zero fonts --- src/FbTk/XftFontImp.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FbTk/XftFontImp.cc b/src/FbTk/XftFontImp.cc index fa34404..f5a6f9a 100644 --- a/src/FbTk/XftFontImp.cc +++ b/src/FbTk/XftFontImp.cc @@ -79,7 +79,7 @@ bool XftFontImp::load(const std::string &name) { // number of glyphs by calculating the amount of 'WW' (pretending a 'wide' // glyph) fitting into 32k pixels unsigned int tw = textWidth("WW", 2); - m_maxlength = 0x8000 / tw; + m_maxlength = 0x8000 / (tw == 0 ? 1 : tw); return true; } -- cgit v0.11.2