Fix an int overflow on very large file systems.

PR:		bin/113399
Submitted by:	Staffan Ulfberg <staffan@ulfberg.se>
This commit is contained in:
David Schultz 2007-12-17 08:03:18 +00:00
parent 228d1e266e
commit baa15be0ea
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=174706

View File

@ -259,8 +259,8 @@ growfs(int fsi, int fso, unsigned int Nflag)
*/
for (cylno = osblock.fs_ncg; cylno < sblock.fs_ncg; cylno++) {
initcg(cylno, utime, fso, Nflag);
j = sprintf(tmpbuf, " %d%s",
(int)fsbtodb(&sblock, cgsblock(&sblock, cylno)),
j = sprintf(tmpbuf, " %jd%s",
(intmax_t)fsbtodb(&sblock, cgsblock(&sblock, cylno)),
cylno < (sblock.fs_ncg-1) ? "," : "" );
if (i + j >= width) {
printf("\n");