mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-22 19:43:02 +01:00
fix for possible divsion by zero
This commit is contained in:
parent
7a89229375
commit
ba750753a5
@ -276,6 +276,10 @@ static void friendlist_onDraw(ToxWindow *self, Tox *m)
|
||||
wattroff(self->window, COLOR_PAIR(CYAN) | A_BOLD);
|
||||
}
|
||||
|
||||
|
||||
if ((y2 - FLIST_OFST) == 0) /* don't allow division by zero */
|
||||
return;
|
||||
|
||||
/* Determine which portion of friendlist to draw based on current position */
|
||||
int page = num_selected / (y2 - FLIST_OFST);
|
||||
int start = (y2 - FLIST_OFST) * page;
|
||||
|
Loading…
Reference in New Issue
Block a user