From 00a8b74b66cfde5f03e1ec77ec90fb3793a1cd7d Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Sun, 22 Nov 2015 21:52:42 -0800 Subject: [PATCH] TAPE: Properly report a tape format error when a TPC format tape fails the record structure validation checks. --- sim_tape.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sim_tape.c b/sim_tape.c index 098ef3bd..a8a085ff 100644 --- a/sim_tape.c +++ b/sim_tape.c @@ -525,14 +525,15 @@ t_stat sim_tape_detach (UNIT *uptr) struct tape_context *ctx = (struct tape_context *)uptr->tape_ctx; uint32 f = MT_GET_FMT (uptr); t_stat r; -t_bool auto_format; +t_bool auto_format = FALSE; if ((uptr == NULL) || !(uptr->flags & UNIT_ATT)) return SCPE_IERR; if (uptr->io_flush) uptr->io_flush (uptr); /* flush buffered data */ -auto_format = ctx->auto_format; +if (ctx) + auto_format = ctx->auto_format; sim_tape_clr_async (uptr);