summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorPedro Martelletto <pedro@cvs.openbsd.org>2007-03-15 10:27:01 +0000
committerPedro Martelletto <pedro@cvs.openbsd.org>2007-03-15 10:27:01 +0000
commitd0264fee37411062e3aff8c4f01c033cf55e799f (patch)
tree473946a9c07785dbf7ca2453d86e371c17110123 /sbin
parentbd2b614cddbdb963198fdd15728e067d209f3cf7 (diff)
Check for cg_irotor and cg_frotor being negative, okay millert@ deraadt@
Diffstat (limited to 'sbin')
-rw-r--r--sbin/fsck_ffs/pass5.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sbin/fsck_ffs/pass5.c b/sbin/fsck_ffs/pass5.c
index e8897528b6b..632763ea009 100644
--- a/sbin/fsck_ffs/pass5.c
+++ b/sbin/fsck_ffs/pass5.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pass5.c,v 1.24 2006/04/27 02:40:03 pedro Exp $ */
+/* $OpenBSD: pass5.c,v 1.25 2007/03/15 10:27:00 pedro 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.24 2006/04/27 02:40:03 pedro Exp $";
+static const char rcsid[] = "$OpenBSD: pass5.c,v 1.25 2007/03/15 10:27:00 pedro Exp $";
#endif
#endif /* not lint */
@@ -212,11 +212,11 @@ pass5(void)
newcg->cg_rotor = cg->cg_rotor;
else
newcg->cg_rotor = 0;
- if (cg->cg_frotor < newcg->cg_ndblk)
+ if (cg->cg_frotor >= 0 && cg->cg_frotor < newcg->cg_ndblk)
newcg->cg_frotor = cg->cg_frotor;
else
newcg->cg_frotor = 0;
- if (cg->cg_irotor < newcg->cg_niblk)
+ if (cg->cg_irotor >= 0 && cg->cg_irotor < newcg->cg_niblk)
newcg->cg_irotor = cg->cg_irotor;
else
newcg->cg_irotor = 0;