If ls was invoked with -i but neither -l nor -s, blocksize was used in

display() to calculate column widths, but was not initialized in
main().  This resulted in a division by zero.

Noticed by:	Michael Butler <imb@protected-networks.net>
This commit is contained in:
Dag-Erling Smørgrav 2011-10-19 15:35:41 +00:00
parent 85dac049c1
commit 4d4dcc7aef
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=226546

View File

@ -414,8 +414,8 @@ main(int argc, char *argv[])
fts_options |= FTS_WHITEOUT;
#endif
/* If -l or -s, figure out block size. */
if (f_longform || f_size) {
/* If -i, -l or -s, figure out block size. */
if (f_inode || f_longform || f_size) {
if (f_kblocks)
blocksize = 2;
else {