[icinga-checkins] icinga.org: icinga2/master: Fix integer truncation in Convert::ToString

git at icinga.org git at icinga.org
Wed Nov 2 08:42:54 CET 2016


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

Author: Gunnar Beutner <gunnar.beutner at icinga.com>
Date:   Wed Nov  2 08:42:24 2016 +0100

Fix integer truncation in Convert::ToString

fixes #12995

---

 lib/base/convert.cpp |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/base/convert.cpp b/lib/base/convert.cpp
index 5454a2f..e563fe8 100644
--- a/lib/base/convert.cpp
+++ b/lib/base/convert.cpp
@@ -39,7 +39,7 @@ String Convert::ToString(double val)
 	double fractional = std::modf(val, &integral);
 
 	if (fractional == 0)
-		return Convert::ToString(static_cast<long>(val));
+		return Convert::ToString(static_cast<long long>(val));
 
 	std::ostringstream msgbuf;
 	msgbuf << std::fixed << val;



More information about the icinga-checkins mailing list