- handled all other uses of fopen that could reasonably converted to FileReader or FileWriter.

This commit is contained in:
Christoph Oelckers 2017-12-02 14:24:28 +01:00
commit 7d0759e2fa
5 changed files with 20 additions and 20 deletions

View file

@ -2488,17 +2488,16 @@ bool D_LoadDehLump(int lumpnum)
bool D_LoadDehFile(const char *patchfile)
{
FILE *deh;
FileReader fr;
deh = fopen(patchfile, "rb");
if (deh != NULL)
if (!fr.Open(patchfile))
{
PatchSize = Q_filelength(deh);
PatchSize = fr.GetLength();
PatchName = copystring(patchfile);
PatchFile = new char[PatchSize + 1];
fread(PatchFile, 1, PatchSize, deh);
fclose(deh);
fr.Read(PatchFile, PatchSize);
fr.Close();
PatchFile[PatchSize] = '\0'; // terminate with a '\0' character
return DoDehPatch();
}