Skip to content

Commit aa1b383

Browse files
committed
fix string construction
1 parent 8bf20bd commit aa1b383

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib_json/json_writer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ JSONCPP_STRING valueToString(double value, bool useSpecialFloats, unsigned int p
137137
return reps[useSpecialFloats ? 0 : 1][isnan(value) ? 0 : (value < 0) ? 1 : 2];
138138
}
139139

140-
JSONCPP_STRING buffer(36);
140+
JSONCPP_STRING buffer(size_t(36), '\0');
141141
while (true) {
142142
int len = snprintf(&*buffer.begin(), buffer.size(),
143143
(precisionType == PrecisionType::significantDigits) ? "%.*g" : "%.*f",

0 commit comments

Comments
 (0)