Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable to open file in ReadWrite mode #120

Merged
merged 1 commit into from
Mar 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/zasm/src/core/filestream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ namespace zasm

FILE* fp = nullptr;
#ifdef _WIN32
_wfopen_s(&fp, path.wstring().c_str(), mode == StreamMode::Read ? L"rb" : L"wb");
_wfopen_s(&fp, path.wstring().c_str(), mode == StreamMode::Read ? L"rb" : mode == StreamMode::Write ? L"wb" : L"r+b");
ZehMatt marked this conversation as resolved.
Show resolved Hide resolved
#else
fp = fopen(path.string().c_str(), mode == StreamMode::Read ? "rb" : "wb");
fp = fopen(path.string().c_str(), mode == StreamMode::Read ? "rb" : mode == StreamMode::Write ? "wb" : "r+b");
ZehMatt marked this conversation as resolved.
Show resolved Hide resolved
#endif
if (fp == nullptr)
{
Expand Down
Loading