tyls: Make sure we never divide by zero
Avoid the case where cols is 0 and we divide through it. CID 1100655
This commit is contained in:
parent
d1810ed034
commit
f1deb3ca3e
|
@ -640,6 +640,7 @@ list_dir(const char *dir, int mode)
|
|||
stuff--;
|
||||
}
|
||||
if (cols > num) cols = num;
|
||||
if (cols == 0) cols = 1;
|
||||
rows = ((num + (cols - 1)) / cols);
|
||||
for (i = 0; i < rows; i++)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue