Opening & closing output file in writeresults
This commit is contained in:
@@ -185,19 +185,6 @@ int openoutfile(Project *pr)
|
|||||||
|
|
||||||
// If output file name was supplied, then attempt to
|
// If output file name was supplied, then attempt to
|
||||||
// open it. Otherwise open a temporary output file.
|
// open it. Otherwise open a temporary output file.
|
||||||
/*
|
|
||||||
if (pr->outfile.Outflag == SAVE)
|
|
||||||
{
|
|
||||||
pr->outfile.OutFile = fopen(pr->outfile.OutFname, "w+b");
|
|
||||||
if (pr->outfile.OutFile == NULL) errcode = 304;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
strcpy(pr->outfile.OutFname, pr->TmpOutFname);
|
|
||||||
pr->outfile.OutFile = fopen(pr->outfile.OutFname, "w+b");
|
|
||||||
if (pr->outfile.OutFile == NULL) errcode = 304;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
pr->outfile.OutFile = fopen(pr->outfile.OutFname, "w+b");
|
pr->outfile.OutFile = fopen(pr->outfile.OutFname, "w+b");
|
||||||
if (pr->outfile.OutFile == NULL) errcode = 304;
|
if (pr->outfile.OutFile == NULL) errcode = 304;
|
||||||
|
|
||||||
|
|||||||
@@ -545,7 +545,7 @@ int writeresults(Project *pr)
|
|||||||
if (nnv == 0 && nlv == 0) return errcode;
|
if (nnv == 0 && nlv == 0) return errcode;
|
||||||
|
|
||||||
// Return if no output file
|
// Return if no output file
|
||||||
// if (outFile == NULL) outFile = fopen(pr->outfile.OutFname, "rb");
|
if (outFile == NULL) outFile = fopen(pr->outfile.OutFname, "rb");
|
||||||
if (outFile == NULL) return 106;
|
if (outFile == NULL) return 106;
|
||||||
|
|
||||||
// Allocate memory for output variables:
|
// Allocate memory for output variables:
|
||||||
@@ -587,14 +587,14 @@ int writeresults(Project *pr)
|
|||||||
time->Htime += time->Rstep;
|
time->Htime += time->Rstep;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
// Free output file
|
// Free output file
|
||||||
if (outFile != NULL)
|
if (outFile != NULL)
|
||||||
{
|
{
|
||||||
fclose(outFile);
|
fclose(outFile);
|
||||||
outFile = NULL;
|
outFile = NULL;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
// Free allocated memory
|
// Free allocated memory
|
||||||
for (j = 0; j < m; j++) free(x[j]);
|
for (j = 0; j < m; j++) free(x[j]);
|
||||||
free(x);
|
free(x);
|
||||||
|
|||||||
Reference in New Issue
Block a user