tyls: Make sure we never divide by zero

Avoid the case where cols is 0 and we divide through it.

CID 1100655
devs/stefan/coverity-fixes
Stefan Schmidt 9 years ago
parent 2e95700161
commit 8ae31617a1
  1. 1
      src/bin/tyls.c

@ -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…
Cancel
Save