fix string construction

This commit is contained in:
Billy Donahue 2018-05-13 18:28:05 -04:00
parent 8bf20bdc35
commit aa1b383666

View File

@ -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",