[icinga-checkins] icinga.org: icinga2/master: Throw exception in Utility::ToDouble/Utility:: ToLong

git at icinga.org git at icinga.org
Sat Feb 2 20:19:16 CET 2013


Module: icinga2
Branch: master
Commit: 5438c86e767f076d214eb611655ae2de5a5914cd
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=5438c86e767f076d214eb611655ae2de5a5914cd

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Sat Feb  2 20:19:00 2013 +0100

Throw exception in Utility::ToDouble/Utility::ToLong

Fixes #3617

---

 lib/base/convert.cpp |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/base/convert.cpp b/lib/base/convert.cpp
index 31301fd..d3bcd1e 100644
--- a/lib/base/convert.cpp
+++ b/lib/base/convert.cpp
@@ -23,12 +23,12 @@ using namespace icinga;
 
 long Convert::ToLong(const String& val)
 {
-	return strtol(val.CStr(), NULL, 10);
+	return boost::lexical_cast<long>(val);
 }
 
 double Convert::ToDouble(const String& val)
 {
-	return strtod(val.CStr(), NULL);
+	return boost::lexical_cast<double>(val);
 }
 
 bool Convert::ToBool(const String& val)





More information about the icinga-checkins mailing list