Skip to content

Commit

Permalink
Merge pull request open-source-parsers#622 from sylvestre/master
Browse files Browse the repository at this point in the history
Allocate the proper memory for formatString. Fix a warning with gcc 7.1
  • Loading branch information
cdunn2001 authored Jun 13, 2017
2 parents d7347a2 + 7f9cc27 commit 56efb6b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib_json/json_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ JSONCPP_STRING valueToString(double value, bool useSpecialFloats, unsigned int p
char buffer[36];
int len = -1;

char formatString[6];
char formatString[15];
snprintf(formatString, sizeof(formatString), "%%.%dg", precision);

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

0 comments on commit 56efb6b

Please sign in to comment.