Added a call to fflush on the hydraulic file when it is written to because it caused issues with the subsequent use of the hydraulic file related to MSX.

git-svn-id: https://epanet.svn.sourceforge.net/svnroot/epanet/BASE/trunk@423 c320cabd-cc23-0410-96d8-e60fbf53ed7f
This commit is contained in:
Tom Taxon
2011-12-06 18:06:01 +00:00
parent eb60c488db
commit a41cdbd540

View File

@@ -174,6 +174,7 @@ int savehyd(long *htime)
if (fwrite(x+1,sizeof(REAL4),Nlinks,HydFile) < (unsigned)Nlinks) if (fwrite(x+1,sizeof(REAL4),Nlinks,HydFile) < (unsigned)Nlinks)
errcode = 308; errcode = 308;
free(x); free(x);
fflush(HydFile); /* added TNT */
return(errcode); return(errcode);
} /* End of savehyd */ } /* End of savehyd */
@@ -193,6 +194,7 @@ int savehydstep(long *hydstep)
t = *hydstep; t = *hydstep;
if (fwrite(&t,sizeof(INT4),1,HydFile) < 1) errcode = 308; if (fwrite(&t,sizeof(INT4),1,HydFile) < 1) errcode = 308;
if (t == 0) fputc(EOFMARK, HydFile); if (t == 0) fputc(EOFMARK, HydFile);
fflush(HydFile); /* added TNT */
return(errcode); return(errcode);
} }