src: Configuration file processing bug fix
If configuration file not found NLSR should exit immediately. But It was not.
So fixed it by returning before loading if file not found.
Change-Id: Id824a2fab0c4556e6b45b928758b065c1fa5dc6f
diff --git a/src/conf-file-processor.cpp b/src/conf-file-processor.cpp
index d2b1881..d07b2e2 100644
--- a/src/conf-file-processor.cpp
+++ b/src/conf-file-processor.cpp
@@ -50,7 +50,7 @@
string msg = "Failed to read configuration file: ";
msg += m_confFileName;
cerr << msg << endl;
- ret = false;
+ return false;
}
ret = load(inputFile);
inputFile.close();
diff --git a/src/main.cpp b/src/main.cpp
index 8a7e439..f7ba8b0 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -60,8 +60,7 @@
}
ConfFileProcessor cfp(nlsr, nlsr.getConfFileName());
if(!cfp.processConfFile()) {
- std::cerr << "Error in configuration file processing! Exiting from NLSR" <<
- std::endl;
+ std::cerr << "Error in configuration file processing! Exiting from NLSR" << std::endl;
return EXIT_FAILURE;
}
INIT_LOGGERS(nlsr.getConfParameter().getLogDir());