aboutsummaryrefslogtreecommitdiff
path: root/lib/jsoncpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/jsoncpp')
-rw-r--r--lib/jsoncpp/jsoncpp/src/lib_json/json_writer.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/jsoncpp/jsoncpp/src/lib_json/json_writer.cpp b/lib/jsoncpp/jsoncpp/src/lib_json/json_writer.cpp
index f2f8311514..2f17428954 100644
--- a/lib/jsoncpp/jsoncpp/src/lib_json/json_writer.cpp
+++ b/lib/jsoncpp/jsoncpp/src/lib_json/json_writer.cpp
@@ -71,7 +71,17 @@ std::string valueToString( double value )
#else
sprintf(buffer, "%#.16g", value);
#endif
- char* ch = buffer + strlen(buffer) - 1;
+ char* ch = buffer;
+ // Incase sprintf have written ',' as decimal point switch it to '.'
+ while (*ch != '\0'){
+ if (*ch == ','){
+ *ch = '.';
+ break;
+ }
+ ch++;
+ }
+
+ ch = buffer + strlen(buffer) - 1;
if (*ch != '0') return buffer; // nothing to truncate, so save time
while(ch > buffer && *ch == '0'){
--ch;