diff options
author | Volker Aßmann <[email protected]> | 2017-06-05 20:18:09 +0200 |
---|---|---|
committer | Volker Aßmann <[email protected]> | 2017-06-05 20:18:09 +0200 |
commit | c4514146df5461763bb4164fc49ac41474e81b29 (patch) | |
tree | 53e9b0ff793b60bc3dfc30212a3fbe8020e9db85 /src | |
parent | b09e37fe0a9ffda932102e269ac20b268488e41a (diff) |
Added std::ios::binary option for istream open in compression. Without
this the compress/uncompress methods may produce corrupted files on
Windows.
Diffstat (limited to 'src')
-rw-r--r-- | src/cli/compress.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cli/compress.cpp b/src/cli/compress.cpp index 6ee6398ee..e0881d025 100644 --- a/src/cli/compress.cpp +++ b/src/cli/compress.cpp @@ -54,7 +54,7 @@ class Compress final : public Command } const std::string in_file = get_arg("file"); - std::ifstream in(in_file); + std::ifstream in(in_file, std::ios::binary); if(!in.good()) { @@ -118,7 +118,7 @@ class Decompress final : public Command std::string out_file, suffix; parse_extension(in_file, out_file, suffix); - std::ifstream in(in_file); + std::ifstream in(in_file, std::ios::binary); if(!in.good()) { |