From 341e9c272fa63c47292f177b06f689d6cd033647 Mon Sep 17 00:00:00 2001 From: Stefano Fiorentino Date: Fri, 12 Feb 2016 12:06:08 +0100 Subject: [PATCH] try to solve incongruency --- src/lib_json/json_writer.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/lib_json/json_writer.cpp b/src/lib_json/json_writer.cpp index 2ab7f79..3e358ae 100644 --- a/src/lib_json/json_writer.cpp +++ b/src/lib_json/json_writer.cpp @@ -143,16 +143,10 @@ std::string valueToString(double value, bool useSpecialFloats, unsigned int prec unsigned int length = (value==0.0)?(unsigned int)1:(unsigned int)(std::floor(std::log10(std::abs(value)))+1); if (length<1) length=1; + if (lenght>precision-1) length = precision-1; char formatString[6]; - if (length