Fix QNX build: QNX defines sprintf under the std namespace. Use snprintf instead

This commit is contained in:
Anton Indrawan 2017-05-01 23:14:23 +02:00
parent a3d35d7fb8
commit 2e319850d1

View File

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