From c910e1c0e24b3f10483e624adb6b9c2a004e39dc Mon Sep 17 00:00:00 2001 From: Stelian Pop Date: Wed, 8 Jun 2011 15:40:53 +0000 Subject: [PATCH] Fix fgets bug when asking for a tape name. --- CHANGES | 6 +++++- restore/tape.c | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 9aff206..5aec318 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,4 @@ -$Id: CHANGES,v 1.325 2011/05/23 08:34:20 stelian Exp $ +$Id: CHANGES,v 1.326 2011/06/08 15:40:53 stelian Exp $ Changes between versions 0.4b43 and 0.4b44 (released ?????????????) @@ -34,6 +34,10 @@ Changes between versions 0.4b43 and 0.4b44 (released ?????????????) 8. Add quick regression script from Bear Giles . +9. Fix a bug introduced in 0.4b43 causing restore to crash when + asking for a new volume when doing multi-volume restores. Thanks + to Patrik Schindler for reporting the bug. + Changes between versions 0.4b42 and 0.4b43 (released June 11, 2010) =================================================================== diff --git a/restore/tape.c b/restore/tape.c index bd411b9..7debfd1 100644 --- a/restore/tape.c +++ b/restore/tape.c @@ -42,7 +42,7 @@ #ifndef lint static const char rcsid[] = - "$Id: tape.c,v 1.101 2011/05/05 16:05:40 stelian Exp $"; + "$Id: tape.c,v 1.102 2011/06/08 15:40:53 stelian Exp $"; #endif /* not lint */ #include @@ -586,7 +586,7 @@ again: fprintf(stderr, "otherwise enter tape name (default: %s) ", magtape); #endif (void) fflush(stderr); - if (fgets(buf, TP_BSIZE, terminal)) + if (!fgets(buf, TP_BSIZE, terminal)) exit(1); if (feof(terminal)) exit(1); -- 2.39.2