From 43e9fa3afde876fee57f5b3d2d4d37b77b8a6127 Mon Sep 17 00:00:00 2001 From: Jan Willem Penterman Date: Tue, 24 Mar 2015 10:03:20 +0100 Subject: [PATCH] Win32/MSVC requires ios::binary flag on ofstream to correctly write dag file --- libdevcore/CommonIO.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libdevcore/CommonIO.cpp b/libdevcore/CommonIO.cpp index 4fa132073..46d6e3a6b 100644 --- a/libdevcore/CommonIO.cpp +++ b/libdevcore/CommonIO.cpp @@ -112,6 +112,6 @@ string dev::contentsString(std::string const& _file) void dev::writeFile(std::string const& _file, bytesConstRef _data) { - ofstream(_file, ios::trunc).write((char const*)_data.data(), _data.size()); + ofstream(_file, ios::trunc|ios::binary).write((char const*)_data.data(), _data.size()); }