From 67e3ee737e267ea27caaf1f4d99d7b2cbed15383 Mon Sep 17 00:00:00 2001 From: Eric Smith Date: Thu, 20 Mar 2003 07:02:28 +0000 Subject: [PATCH] fix multiple close of input file. --- tumble_input.c | 9 ++++++--- tumble_tiff.c | 4 +--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/tumble_input.c b/tumble_input.c index 7999f01..5f18b58 100644 --- a/tumble_input.c +++ b/tumble_input.c @@ -2,7 +2,7 @@ * tumble: build a PDF file from image files * * Input handler dispatch - * $Id: tumble_input.c,v 1.1 2003/03/19 22:54:08 eric Exp $ + * $Id: tumble_input.c,v 1.2 2003/03/19 23:02:28 eric Exp $ * Copyright 2001, 2002, 2003 Eric Smith * * This program is free software; you can redistribute it and/or modify @@ -106,8 +106,11 @@ bool close_input_file (void) result = current_input_handler->close_input_file (); if (in_filename) free (in_filename); - fclose (in); - in = NULL; + if (in) + { + fclose (in); + in = NULL; + } return (result); } diff --git a/tumble_tiff.c b/tumble_tiff.c index 134c63f..4a4081c 100644 --- a/tumble_tiff.c +++ b/tumble_tiff.c @@ -1,7 +1,7 @@ /* * tumble: build a PDF file from image files * - * $Id: tumble_tiff.c,v 1.1 2003/03/19 22:54:08 eric Exp $ + * $Id: tumble_tiff.c,v 1.2 2003/03/19 23:02:28 eric Exp $ * Copyright 2001, 2002, 2003 Eric Smith * * This program is free software; you can redistribute it and/or modify @@ -65,8 +65,6 @@ bool open_tiff_input_file (FILE *f, char *name) if ((buf [0] != 0x49) || (buf [1] != 0x49)) return (0); - /* $$$ should we dup the file descriptor here, so that later closing f - won't cause problems? */ tiff_in = TIFFFdOpen (fileno (f), name, "r"); if (! tiff_in) {