Walking back closing/opening output file

This commit is contained in:
Lew Rossman
2019-03-05 15:20:37 -05:00
parent 692955e3d2
commit 8052ed0b6f
2 changed files with 6 additions and 7 deletions

View File

@@ -545,11 +545,8 @@ int writeresults(Project *pr)
if (nnv == 0 && nlv == 0) return errcode;
// Return if no output file
if (outFile == NULL)
{
outFile = fopen(pr->outfile.OutFname, "r+b");
if (outFile == NULL) return 106;
}
// if (outFile == NULL) outFile = fopen(pr->outfile.OutFname, "r+b");
if (outFile == NULL) return 106;
// Allocate memory for output variables:
// m = larger of # node variables & # link variables
@@ -590,14 +587,14 @@ int writeresults(Project *pr)
time->Htime += time->Rstep;
}
}
/*
// Free output file
if (outFile != NULL)
{
fclose(outFile);
outFile = NULL;
}
*/
// Free allocated memory
for (j = 0; j < m; j++) free(x[j]);
free(x);