diff --git a/.cproject b/.cproject
index dadd7bd..01d0ced 100644
--- a/.cproject
+++ b/.cproject
@@ -22,11 +22,13 @@
-
+
+
+
@@ -89,7 +91,7 @@
-
+
@@ -100,7 +102,7 @@
-
+
@@ -145,11 +147,14 @@
+
+
+
@@ -160,6 +165,7 @@
+
diff --git a/source/Main.cpp b/source/Main.cpp
index eeefa67..a15cbd3 100644
--- a/source/Main.cpp
+++ b/source/Main.cpp
@@ -21,15 +21,21 @@ int main(int argc, char* argv[])
// Add a switch to have regular ouput to a log file or debug to command line
// http://stackoverflow.com/questions/12774207/fastest-way-to-check-if-a-file-exist-using-standard-c-c11-c
- ifstream file_exists("debug");
+ ifstream debug_file_exists("debug");
// File does not exist, so redirect to log file
- // http://stackoverflow.com/questions/10150468/how-to-redirect-cin-and-cout-to-files
- std::ofstream out("log.txt");
- if (!file_exists.good()){
- //std::streambuf *coutbuf = std::cout.rdbuf(); //save old buf
+ // http://stackoverflow.com/questions/10150468/how-to-redirect-cin-and-cout-to-files
+ std::ofstream out("log.txt");
+ std::streambuf *coutbuf = std::cout.rdbuf(); //save old buffer
+ if (!debug_file_exists.good()){
std::cout.rdbuf(out.rdbuf());
+ }//*
+ else
+ {
+ std::cout.rdbuf(coutbuf);
}
- file_exists.close();
+ //*/
+ debug_file_exists.close();
+
@@ -245,6 +251,8 @@ int main(int argc, char* argv[])
}
+ out.close(); // close output stream
+ std::cout.rdbuf(coutbuf); // reassign buffer to avoid crash
// And it is done. Return 0 as the code has finished.
return 0;
}
diff --git a/source/mechanism_reduction/Species_Class_Mapping.cpp b/source/mechanism_reduction/Species_Class_Mapping.cpp
index 5c98e55..75b2493 100644
--- a/source/mechanism_reduction/Species_Class_Mapping.cpp
+++ b/source/mechanism_reduction/Species_Class_Mapping.cpp
@@ -65,8 +65,8 @@ vector< int > Map_Species_Classes(
NumberOfClasses = CountUnmappedSpecies + BiggestClass; // sum of unmapped species and the number of classes
cout << "The Mapping consists of " << CountUnmappedSpecies << " unmapped Species, and "
- << BiggestClass << "dedicated class mappings, resulting in " << NumberOfClasses
- << "Species Classes. \n";
+ << BiggestClass << " dedicated class mappings, resulting in " << NumberOfClasses
+ << " Species Classes. \n";
// Classed species have a number, unclassed species get identified via a negative ID:
// This will only work if I coded the rest well as position 0 drops out