From 4fadeed69d00924e9b370a1aed3ebea603636314 Mon Sep 17 00:00:00 2001 From: das Date: Mon, 17 Dec 2007 08:03:18 +0000 Subject: Fix an int overflow on very large file systems. PR: bin/113399 Submitted by: Staffan Ulfberg --- sbin/growfs/growfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sbin/growfs') diff --git a/sbin/growfs/growfs.c b/sbin/growfs/growfs.c index dab9ba7..89b14da 100644 --- a/sbin/growfs/growfs.c +++ b/sbin/growfs/growfs.c @@ -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"); -- cgit v1.1