Skip to content

Commit 56efb6b

Browse files
authored
Merge pull request open-source-parsers#622 from sylvestre/master
Allocate the proper memory for formatString. Fix a warning with gcc 7.1
2 parents d7347a2 + 7f9cc27 commit 56efb6b

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
@@ -142,7 +142,7 @@ JSONCPP_STRING valueToString(double value, bool useSpecialFloats, unsigned int p
142142
char buffer[36];
143143
int len = -1;
144144

145-
char formatString[6];
145+
char formatString[15];
146146
snprintf(formatString, sizeof(formatString), "%%.%dg", precision);
147147

148148
// Print into the buffer. We need not request the alternative representation

0 commit comments

Comments
 (0)