Skip to content

Commit 2e31985

Browse files
Fix QNX build: QNX defines sprintf under the std namespace. Use snprintf instead
1 parent a3d35d7 commit 2e31985

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib_json/json_writer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ JSONCPP_STRING valueToString(double value, bool useSpecialFloats, unsigned int p
143143
int len = -1;
144144

145145
char formatString[6];
146-
sprintf(formatString, "%%.%dg", precision);
146+
snprintf(formatString, sizeof(formatString), "%%.%dg", precision);
147147

148148
// Print into the buffer. We need not request the alternative representation
149149
// that always has a decimal point because JSON doesn't distingish the

0 commit comments

Comments
 (0)