Merge pull request #707 from remyjette/valuetostring-sign-mismatch

Fix sign mismatch in `valueToString`
This commit is contained in:
Christopher Dunn 2017-12-04 20:02:47 -06:00 committed by GitHub
commit c39aa295e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -125,7 +125,7 @@ JSONCPP_STRING valueToString(double value, bool useSpecialFloats, unsigned int p
int len = -1;
char formatString[15];
snprintf(formatString, sizeof(formatString), "%%.%dg", precision);
snprintf(formatString, sizeof(formatString), "%%.%ug", precision);
// Print into the buffer. We need not request the alternative representation
// that always has a decimal point because JSON doesn't distinguish the