summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2007-04-21 19:25:53 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2007-04-21 19:25:53 +0000
commit301d8f3daf3fb35cbac46853a99f9c6a2e4bd0a9 (patch)
treed158d568d9ed30621fd1d418e4979244d4d3ce43 /sbin
parent97664a86886c68066f439f97a3bafbdd7f54d659 (diff)
use the correct size arg to memcmp when checking fs_cstotal.
now jmc does not use 8TB in /tmp anymore. ok pedro@
Diffstat (limited to 'sbin')
-rw-r--r--sbin/fsck_ffs/pass5.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sbin/fsck_ffs/pass5.c b/sbin/fsck_ffs/pass5.c
index 5b8a749c03d..41c195e46f4 100644
--- a/sbin/fsck_ffs/pass5.c
+++ b/sbin/fsck_ffs/pass5.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pass5.c,v 1.27 2007/04/10 16:08:17 millert Exp $ */
+/* $OpenBSD: pass5.c,v 1.28 2007/04/21 19:25:52 otto Exp $ */
/* $NetBSD: pass5.c,v 1.16 1996/09/27 22:45:18 christos Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)pass5.c 8.6 (Berkeley) 11/30/94";
#else
-static const char rcsid[] = "$OpenBSD: pass5.c,v 1.27 2007/04/10 16:08:17 millert Exp $";
+static const char rcsid[] = "$OpenBSD: pass5.c,v 1.28 2007/04/21 19:25:52 otto Exp $";
#endif
#endif /* not lint */
@@ -383,9 +383,11 @@ pass5(void)
info_fn = NULL;
if (fs->fs_postblformat == FS_42POSTBLFMT)
fs->fs_nrpos = savednrpos;
- if (memcmp(&cstotal, &fs->fs_cstotal, sizeof *cs) != 0
+
+ sumsize = sizeof(cstotal) - sizeof(cstotal.cs_spare);
+ if (memcmp(&cstotal, &fs->fs_cstotal, sumsize) != 0
&& dofix(&idesc[0], "FREE BLK COUNT(S) WRONG IN SUPERBLK")) {
- memcpy(&fs->fs_cstotal, &cstotal, sizeof *cs);
+ memcpy(&fs->fs_cstotal, &cstotal, sumsize);
fs->fs_ronly = 0;
fs->fs_fmod = 0;
sbdirty();