From aa1b3836667d3af20ef3f66a3cb5e1e321f41854 Mon Sep 17 00:00:00 2001 From: Billy Donahue Date: Sun, 13 May 2018 18:28:05 -0400 Subject: [PATCH] fix string construction --- src/lib_json/json_writer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib_json/json_writer.cpp b/src/lib_json/json_writer.cpp index 2cddbdb..30c6833 100644 --- a/src/lib_json/json_writer.cpp +++ b/src/lib_json/json_writer.cpp @@ -137,7 +137,7 @@ JSONCPP_STRING valueToString(double value, bool useSpecialFloats, unsigned int p return reps[useSpecialFloats ? 0 : 1][isnan(value) ? 0 : (value < 0) ? 1 : 2]; } - JSONCPP_STRING buffer(36); + JSONCPP_STRING buffer(size_t(36), '\0'); while (true) { int len = snprintf(&*buffer.begin(), buffer.size(), (precisionType == PrecisionType::significantDigits) ? "%.*g" : "%.*f",