]> granicus.if.org Git - icinga2/commitdiff
Fix integer truncation in Convert::ToString
authorGunnar Beutner <gunnar.beutner@icinga.com>
Wed, 2 Nov 2016 07:42:24 +0000 (08:42 +0100)
committerGunnar Beutner <gunnar.beutner@icinga.com>
Wed, 2 Nov 2016 07:42:24 +0000 (08:42 +0100)
fixes #12995

lib/base/convert.cpp

index 5454a2fc03572b0d63a203efa9904f4a71b7ad14..e563fe83750099e6322fce93472d267442ea3f27 100644 (file)
@@ -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;