Skip to content
Snippets Groups Projects
Commit 8fa88952 authored by Carsten Patzke's avatar Carsten Patzke
Browse files

Open file in binary mode

parent 036fecf5
No related branches found
No related tags found
No related merge requests found
......@@ -122,6 +122,7 @@ std::string SystemIO::ReadFileToString(const std::string& fname, Error* err) con
return "";
}
//TODO: What if the file size changed during calls? (I ran into that issue: EOF)
auto data = GetDataFromFile(fname, info.size, err);
if (*err != nullptr) {
return "";
......
......@@ -200,7 +200,7 @@ void hidra2::SystemIO::ApplyNetworkOptions(SocketDescriptor socket_fd, Error* er
FileDescriptor SystemIO::_open(const char* filename, int posix_open_flags) const {
int fd;
errno = _sopen_s(&fd, filename, posix_open_flags, _SH_DENYNO, _S_IREAD | _S_IWRITE);
errno = _sopen_s(&fd, filename, posix_open_flags | _O_BINARY, _SH_DENYNO, _S_IREAD | _S_IWRITE);
return fd;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment