From: Giacomo Comes Date: Tue, 7 Jun 2016 14:31:28 +0000 (-0400) Subject: call fclose(infile) after print_progress() X-Git-Tag: 2.2.4~5 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=542fce33d4f38053930d032ba7bf79691f0eb865;p=oweals%2Fcde.git call fclose(infile) after print_progress() The function print_progress uses the pointer infile. If fclose is called before print_progress then the build process can fail to build the files: doc/C/cde.dti/CDEDOC/dtsearch/CDEDOC.d99 doc/C/cde.dti/CDEDOC/dtsearch/dtsearch.ocf doc/C/cde.dti/cde.oli To fix the issue move the call fclose(infile) after print_progress() --- diff --git a/cde/programs/dtsr/dtsrload.c b/cde/programs/dtsr/dtsrload.c index abe0b090..703cab08 100644 --- a/cde/programs/dtsr/dtsrload.c +++ b/cde/programs/dtsr/dtsrload.c @@ -1263,9 +1263,9 @@ int main (int argc, char *argv[]) } /* end main record loop */ - fclose (infile); if (need_final_progress_msg) print_progress (); + fclose (infile); write_dbrec (); /* If all input records were discarded, complete processing