diff options
-rw-r--r-- | src/filters/data_snk.cpp | 6 | ||||
-rw-r--r-- | src/filters/data_src.cpp | 15 |
2 files changed, 10 insertions, 11 deletions
diff --git a/src/filters/data_snk.cpp b/src/filters/data_snk.cpp index d61fcc61f..82ffddc53 100644 --- a/src/filters/data_snk.cpp +++ b/src/filters/data_snk.cpp @@ -40,9 +40,9 @@ DataSink_Stream::DataSink_Stream(std::ostream& out, DataSink_Stream::DataSink_Stream(const std::string& path, bool use_binary) : identifier(path), - sink_p(use_binary ? - new std::ofstream(path.c_str(), std::ios::binary) : - new std::ofstream(path.c_str())), + sink_p(new std::ofstream( + path.c_str(), + use_binary ? std::ios::binary : std::ios::out)), sink(*sink_p) { if(!sink.good()) diff --git a/src/filters/data_src.cpp b/src/filters/data_src.cpp index 522ce09d0..eceb0184a 100644 --- a/src/filters/data_src.cpp +++ b/src/filters/data_src.cpp @@ -171,18 +171,17 @@ std::string DataSource_Stream::id() const DataSource_Stream::DataSource_Stream(const std::string& path, bool use_binary) : identifier(path), - source_p(use_binary ? - new std::ifstream(path.c_str()) : - new std::ifstream(path.c_str(), std::ios::binary)), - source(*source_p) + source_p(new std::ifstream( + path.c_str(), + use_binary ? std::ios::binary : std::ios::in)), + source(*source_p), + total_read(0) { if(!source.good()) { delete source_p; throw Stream_IO_Error("DataSource: Failure opening file " + path); } - - total_read = 0; } /* @@ -192,9 +191,9 @@ DataSource_Stream::DataSource_Stream(std::istream& in, const std::string& name) : identifier(name), source_p(0), - source(in) + source(in), + total_read(0) { - total_read = 0; } /* |