diff --git a/src/jsontestrunner/main.cpp b/src/jsontestrunner/main.cpp index ba98587..46eb872 100644 --- a/src/jsontestrunner/main.cpp +++ b/src/jsontestrunner/main.cpp @@ -8,6 +8,7 @@ #include #include // sort +#include #include #if defined(_MSC_VER) && _MSC_VER >= 1310 @@ -158,8 +159,10 @@ static int rewriteValueTree(const std::string& rewritePath, std::string& rewrite) { // Json::FastWriter writer; // writer.enableYAMLCompatibility(); - Json::StyledWriter writer; - rewrite = writer.write(root); + Json::StyledStreamWriter writer; + std::ostringstream sout; + writer.write(sout, root); + rewrite = sout.str(); FILE* fout = fopen(rewritePath.c_str(), "wt"); if (!fout) { printf("Failed to create rewrite file: %s\n", rewritePath.c_str());