From 368e2935e20b4148c91f4242bee39bb02cd296ae Mon Sep 17 00:00:00 2001 From: ryluchs17 Date: Sun, 7 Jul 2019 19:07:56 -0400 Subject: [PATCH] zero check now uses std::max() --- src/FbTk/XftFontImp.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/FbTk/XftFontImp.cc b/src/FbTk/XftFontImp.cc index f5a6f9a6..9c09a5c8 100644 --- a/src/FbTk/XftFontImp.cc +++ b/src/FbTk/XftFontImp.cc @@ -78,8 +78,8 @@ bool XftFontImp::load(const std::string &name) { // overflow'). to prevent something like this we detect the maximium // 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 == 0 ? 1 : tw); + unsigned int tw = std::max(textWidth("WW", 2), 1); + m_maxlength = 0x8000 / tw; return true; }