From ddde5e41a3bb4acbfff597b726f67481508f021a Mon Sep 17 00:00:00 2001 From: obligaron Date: Mon, 10 May 2021 00:27:45 +0200 Subject: [PATCH] Convert ReadOnlyTest to fileStream --- Source/restrict.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/restrict.cpp b/Source/restrict.cpp index 448dcc56d..10ccc2dc9 100644 --- a/Source/restrict.cpp +++ b/Source/restrict.cpp @@ -5,6 +5,7 @@ */ #include "appfat.h" +#include "utils/file_util.h" #include "utils/paths.h" namespace devilution { @@ -16,12 +17,11 @@ namespace devilution { void ReadOnlyTest() { const std::string path = paths::PrefPath() + "Diablo1ReadOnlyTest.foo"; - FILE *f = fopen(path.c_str(), "wt"); - if (f == nullptr) { + auto fileStream = CreateFileStream(path.c_str(), std::ios::in | std::ios::out); + if (fileStream->fail()) { DirErrorDlg(paths::PrefPath().c_str()); } - fclose(f); remove(path.c_str()); }