summaryrefslogtreecommitdiff
path: root/sbin/scan_ffs
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1999-06-08 19:13:54 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1999-06-08 19:13:54 +0000
commita9951e1bb2bc5db35983e83f31043ecba8565c44 (patch)
tree0f6a62391561283ffb7f6da372d273e32e090fe3 /sbin/scan_ffs
parent8ba1851ae7534a545fbd27fe811ca6bfba82ea48 (diff)
Some large partition fixes
Diffstat (limited to 'sbin/scan_ffs')
-rw-r--r--sbin/scan_ffs/scan_ffs.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sbin/scan_ffs/scan_ffs.c b/sbin/scan_ffs/scan_ffs.c
index c2037a02c13..43b12c37c81 100644
--- a/sbin/scan_ffs/scan_ffs.c
+++ b/sbin/scan_ffs/scan_ffs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scan_ffs.c,v 1.4 1998/03/28 01:18:38 deraadt Exp $ */
+/* $OpenBSD: scan_ffs.c,v 1.5 1999/06/08 19:13:53 niklas Exp $ */
/*
* Copyright (c) 1998 Niklas Hallqvist, Tobias Weingartner
@@ -66,7 +66,7 @@ ufsscan(fd, beg, end, flags)
for(blk = beg; blk <= ((end<0)?blk:end); blk += (SBCOUNT*SBSIZE/512)){
memset(buf, 0, SBSIZE * SBCOUNT);
- if (lseek(fd, blk * 512, SEEK_SET) < 0)
+ if (lseek(fd, (off_t)blk * 512, SEEK_SET) < 0)
err(1, "lseek");
if (read(fd, buf, SBSIZE * SBCOUNT) < 0)
err(1, "read");
@@ -82,19 +82,19 @@ ufsscan(fd, beg, end, flags)
if (((blk+(n/512)) - lastblk) == (SBSIZE/512)) {
if (flags & FLAG_LABELS ) {
printf("X: %d %d 4.2BSD %d %d %d # %s\n",
- sb->fs_size * sb->fs_fsize / 512,
+ (daddr_t)((off_t)sb->fs_size * sb->fs_fsize / 512),
blk+(n/512)-(2*SBSIZE/512),
sb->fs_fsize, sb->fs_bsize,
sb->fs_cpg, lastmount);
} else {
- printf("ffs at %d size %d mount %s time %s",
+ printf("ffs at %d size %qd mount %s time %s",
blk+(n/512)-(2*SBSIZE/512),
- sb->fs_size * sb->fs_fsize,
+ (off_t)sb->fs_size * sb->fs_fsize,
lastmount, ctime(&sb->fs_time));
}
if (flags & FLAG_SMART) {
- int size = sb->fs_size * sb->fs_fsize;
+ off_t size = (off_t)sb->fs_size * sb->fs_fsize;
if ((n + size) < (SBSIZE * SBCOUNT))
n += size;