Skip to content

Commit

Permalink
Merge pull request open-source-parsers#707 from remyjette/valuetostri…
Browse files Browse the repository at this point in the history
…ng-sign-mismatch

Fix sign mismatch in `valueToString`
  • Loading branch information
cdunn2001 authored Dec 5, 2017
2 parents e6a588a + 42ca02b commit c39aa29
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 @@ -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
Expand Down

0 comments on commit c39aa29

Please sign in to comment.