avoid division by zero

Origin commit data
------------------
Branch: ni/coolstream
Commit: 49c86a38b4
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2016-04-21 (Thu, 21 Apr 2016)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
Jacek Jendrzej
2016-04-21 18:08:17 +02:00
parent 0fad6b7256
commit d44c7b1a9d
4 changed files with 24 additions and 18 deletions

View File

@@ -2161,9 +2161,9 @@ void CChannelList::paintBody()
const int ypos = y+ theight;
const int sb = height - theight - footerHeight; // paint scrollbar over full height of main box
frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_MENUCONTENT_PLUS_1);
int sbc= (((*chanlist).size()- 1)/ listmaxshow)+ 1;
const int sbs= (selected/listmaxshow);
unsigned int listmaxshow_tmp = listmaxshow ? listmaxshow : 1;//avoid division by zero
int sbc= (((*chanlist).size()- 1)/ listmaxshow_tmp)+ 1;
const int sbs= (selected/listmaxshow_tmp);
if (sbc < 1)
sbc = 1;