Merge pull request #622 from sylvestre/master

Allocate the proper memory for formatString. Fix a warning with gcc 7.1
This commit is contained in:
Christopher Dunn 2017-06-12 19:44:58 -05:00 committed by GitHub
commit 56efb6ba83

View File

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