mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2024-12-28 03:50:53 +08:00
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:
commit
56efb6ba83
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user