From 2e319850d106908af60a446a2b8419ccbe678035 Mon Sep 17 00:00:00 2001 From: Anton Indrawan Date: Mon, 1 May 2017 23:14:23 +0200 Subject: [PATCH] Fix QNX build: QNX defines sprintf under the std namespace. Use snprintf instead --- src/lib_json/json_writer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib_json/json_writer.cpp b/src/lib_json/json_writer.cpp index 3da9237..0454215 100644 --- a/src/lib_json/json_writer.cpp +++ b/src/lib_json/json_writer.cpp @@ -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