ChangeLog, jfs_compat.h, journal.c, pass3.c:
  jfs_compat.h (J_ASSERT):
  journal.c (e2fsck_run_ext3_journal):
  pass3.c (adjust_inode_count): Use fatal_error() instead of exit().
ChangeLog, super.c:
  super.c (release_orphan_inodes): Fix typo; should do bounds checking
  	on next_ino instead of ino.

diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog
index e028566..de93ab1 100644
--- a/e2fsck/ChangeLog
+++ b/e2fsck/ChangeLog
@@ -1,5 +1,12 @@
 2000-08-22    <tytso@valinux.com>
 
+	* super.c (release_orphan_inodes): Fix typo; should do bounds
+		checking on next_ino instead of ino.
+
+	* jfs_compat.h (J_ASSERT): 
+	* journal.c (e2fsck_run_ext3_journal): 
+	* pass3.c (adjust_inode_count): Use fatal_error() instead of exit().
+
 	* unix.c: Use fatal_error() instead of exit() whenever possible.
 		Also fix the fsck exit codes so that we use FSCK_USAGE
 		when it is appropriate.  Rename global_signal_ctx to
diff --git a/e2fsck/jfs_compat.h b/e2fsck/jfs_compat.h
index 1fa49ca..d0e1da5 100644
--- a/e2fsck/jfs_compat.h
+++ b/e2fsck/jfs_compat.h
@@ -43,12 +43,15 @@
 #define fsync_dev(dev) do {} while(0)
 #define buffer_req(bh) 1
 #define do_readahead(journal, start) do {} while(0)
+	
+extern e2fsck_t e2fsck_global_ctx;  /* Try your very best not to use this! */
+
 #define J_ASSERT(assert)						\
 	do { if (!(assert)) {						\
 		printf ("Assertion failure in %s() at %s line %d: "	\
 			"\"%s\"\n",					\
 			__FUNCTION__, __FILE__, __LINE__, # assert);	\
-		exit(FSCK_ERROR);					\
+		fatal_error(e2fsck_global_ctx, 0);			\
 	} } while (0)
 
 #endif /* _JFS_COMPAT_H */
diff --git a/e2fsck/journal.c b/e2fsck/journal.c
index 64c2445..c9f67d0 100644
--- a/e2fsck/journal.c
+++ b/e2fsck/journal.c
@@ -616,7 +616,7 @@
 		com_err(ctx->program_name, retval,
 			_("while trying to re-open %s"),
 			ctx->device_name);
-		exit(FSCK_ERROR);
+		fatal_error(ctx, 0);
 	}
 	ctx->fs->priv_data = ctx;
 
diff --git a/e2fsck/pass3.c b/e2fsck/pass3.c
index e3cd8d1..9344e55 100644
--- a/e2fsck/pass3.c
+++ b/e2fsck/pass3.c
@@ -581,9 +581,8 @@
 		inode.i_links_count--;
 	} else {
 		/* Should never happen */
-		printf(_("Debug error in e2fsck adjust_inode_count, "
-		       "should never happen.\n"));
-		exit(1);
+		fatal_error(ctx, _("Debug error in e2fsck adjust_inode_count, "
+				   "should never happen.\n"));
 	}
 	
 	retval = ext2fs_write_inode(fs, ino, &inode);
diff --git a/e2fsck/super.c b/e2fsck/super.c
index 8e8c8aa..7875dc1 100644
--- a/e2fsck/super.c
+++ b/e2fsck/super.c
@@ -180,8 +180,9 @@
 		}
 		next_ino = inode.i_dtime;
 		if (next_ino &&
-		    ((ino < EXT2_FIRST_INODE(fs->super)) ||
-		     (ino > fs->super->s_inodes_count))) {
+		    ((next_ino < EXT2_FIRST_INODE(fs->super)) ||
+		     (next_ino > fs->super->s_inodes_count))) {
+			pctx.ino = next_ino;
 			fix_problem(ctx, PR_0_ORPHAN_ILLEGAL_INODE, &pctx);
 			goto abort;
 		}