Initialize all file pointers to NULL in initpointers

This commit is contained in:
Lew Rossman
2019-03-05 20:50:34 -05:00
parent 324487ba86
commit 8765dfa3ab
2 changed files with 8 additions and 2 deletions

View File

@@ -819,13 +819,13 @@ int DLLEXPORT EN_closeQ(EN_Project p)
if (!p->Openflag) return 102; if (!p->Openflag) return 102;
closequal(p); closequal(p);
p->quality.OpenQflag = FALSE; p->quality.OpenQflag = FALSE;
/*
if (p->outfile.OutFile != NULL) if (p->outfile.OutFile != NULL)
{ {
fclose(p->outfile.OutFile); fclose(p->outfile.OutFile);
p->outfile.OutFile = NULL; p->outfile.OutFile = NULL;
} }
*/
return 0; return 0;
} }

View File

@@ -266,6 +266,12 @@ void initpointers(Project *pr)
pr->hydraul.smatrix.NZSUB = NULL; pr->hydraul.smatrix.NZSUB = NULL;
pr->hydraul.smatrix.LNZ = NULL; pr->hydraul.smatrix.LNZ = NULL;
pr->outfile.OutFile = NULL;
pr->outfile.HydFile = NULL;
pr->outfile.TmpOutFile = NULL;
pr->parser.InFile = NULL;
pr->report.RptFile = NULL;
initrules(pr); initrules(pr);
} }