Skip to content

Commit c39aa29

Browse files
authored
Merge pull request #707 from remyjette/valuetostring-sign-mismatch
Fix sign mismatch in `valueToString`
2 parents e6a588a + 42ca02b commit c39aa29

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/lib_json/json_writer.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ JSONCPP_STRING valueToString(double value, bool useSpecialFloats, unsigned int p
125125
int len = -1;
126126

127127
char formatString[15];
128-
snprintf(formatString, sizeof(formatString), "%%.%dg", precision);
128+
snprintf(formatString, sizeof(formatString), "%%.%ug", precision);
129129

130130
// Print into the buffer. We need not request the alternative representation
131131
// that always has a decimal point because JSON doesn't distinguish the

0 commit comments

Comments
 (0)