From: Francis Dupont Date: Sun, 3 Feb 2019 10:38:12 +0000 (+0100) Subject: [429-Updated-StampedValue-to-support-reals] Fixed the 7.0 issue X-Git-Tag: 340-make-perfdhcp-build-optional_base~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=093b33338e4ef2bef4210bd049ce9e4d51f6d051;p=thirdparty%2Fkea.git [429-Updated-StampedValue-to-support-reals] Fixed the 7.0 issue --- diff --git a/src/lib/cc/stamped_value.cc b/src/lib/cc/stamped_value.cc index 4371624430..1ce5a0bfdf 100644 --- a/src/lib/cc/stamped_value.cc +++ b/src/lib/cc/stamped_value.cc @@ -114,7 +114,14 @@ StampedValue::getValue() const { case Element::boolean: return (value_->boolValue() ? "1" : "0"); case Element::real: - return (boost::lexical_cast(value_->doubleValue())); + { + std::string repr = + boost::lexical_cast(value_->doubleValue()); + if (repr.find_first_of('.') == std::string::npos) { + repr += ".0"; + } + return (repr); + } default: // Impossible condition. isc_throw(TypeError, "StampedValue: invalid type of the '" @@ -125,6 +132,7 @@ StampedValue::getValue() const { isc_throw(BadValue, "StampedValue: unable to convert the value of " "the parameter '" << name_ << "' to string"); } + // unreachable return (value_->stringValue()); }