CComponentsFooter: avoid crash because possible divisions by 0

This commit is contained in:
2017-04-13 23:28:35 +02:00
parent b4bb9ef5ea
commit fb0dc47e35

View File

@@ -111,6 +111,9 @@ void CComponentsFooter::setButtonLabels(const struct button_label_cc * const con
if (chain) if (chain)
chain->clear(); chain->clear();
if (label_count == 0)
return;
/* set general available full basic space for button chain, /* set general available full basic space for button chain,
* in this case this is footer width * in this case this is footer width
*/ */
@@ -372,7 +375,6 @@ void CComponentsFooter::paintButtons(const int& x_pos,
this->setButtonFont(font); this->setButtonFont(font);
this->setContextButton(context_buttons); this->setContextButton(context_buttons);
this->setButtonLabels(content, label_count, 0, label_width); this->setButtonLabels(content, label_count, 0, label_width);
this->paint(do_save_bg); this->paint(do_save_bg);
} }