X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=common%2FclitkCommon.cxx;h=10f608e6ce8b7ba7c92d6085f4d1b1588a047e3d;hb=69667910c62b2c9e30d795a9af668855a8de78d3;hp=3c16d879e7a39c055b26690b4c27676919c5a182;hpb=dfde44dc499b7c5f6f7a7613b74676283e0d53f2;p=clitk.git diff --git a/common/clitkCommon.cxx b/common/clitkCommon.cxx index 3c16d87..10f608e 100644 --- a/common/clitkCommon.cxx +++ b/common/clitkCommon.cxx @@ -41,7 +41,7 @@ void clitk::skipComment(std::istream & is) is >> c; if (is.eof()) return; } - if (!(is.fail()) || c != '\n') + if (!(is.fail()) && c != '\n') is.unget(); } //// //------------------------------------------------------------------ @@ -243,7 +243,7 @@ double clitk::ComputeEuclideanDistanceFromPointToPlane(const itk::ContinuousInde // Open a file for reading void clitk::openFileForReading(std::ifstream & is, const std::string & filename) { - is.open(filename.c_str(), std::ios::in); + is.open(filename.c_str(), std::ios::in | std::ios::binary); if ( is.fail() ) { clitkExceptionMacro("Could not open file for reading: " << filename << ". Error is : <"