From 301d8f3daf3fb35cbac46853a99f9c6a2e4bd0a9 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Sat, 21 Apr 2007 19:25:53 +0000 Subject: use the correct size arg to memcmp when checking fs_cstotal. now jmc does not use 8TB in /tmp anymore. ok pedro@ --- sbin/fsck_ffs/pass5.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'sbin') 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(); -- cgit v1.2.3