diff --git a/include/json/reader.h b/include/json/reader.h index fb2365a..bd7b075 100644 --- a/include/json/reader.h +++ b/include/json/reader.h @@ -36,8 +36,9 @@ namespace Json { * * \deprecated Use CharReader and CharReaderBuilder. */ -class [[deprecated( - "deprecated Use CharReader and CharReaderBuilder.")]] JSON_API Reader { +class JSON_API + [[deprecated("deprecated Use CharReader and CharReaderBuilder.")]] + Reader { public: typedef char Char; typedef const Char* Location; diff --git a/include/json/writer.h b/include/json/writer.h index 9799a3b..8ad325f 100644 --- a/include/json/writer.h +++ b/include/json/writer.h @@ -145,7 +145,9 @@ public: /** \brief Abstract class for writers. * \deprecated Use StreamWriter. (And really, this is an implementation detail.) */ -class [[deprecated("Use StreamWriter instead")]] JSON_API Writer { +class JSON_API + [[deprecated("Use StreamWriter instead")]] + Writer { public: virtual ~Writer(); @@ -165,8 +167,9 @@ public: #pragma warning(push) #pragma warning(disable : 4996) // Deriving from deprecated class #endif -class [[deprecated("Use StreamWriterBuilder instead")]] JSON_API FastWriter - : public Writer { +class JSON_API + [[deprecated("Use StreamWriterBuilder instead")]] + FastWriter : public Writer { public: FastWriter(); ~FastWriter() override = default; @@ -225,8 +228,9 @@ private: #pragma warning(push) #pragma warning(disable : 4996) // Deriving from deprecated class #endif -class [[deprecated("Use StreamWriterBuilder instead")]] JSON_API StyledWriter - : public Writer { +class JSON_API + [[deprecated("Use StreamWriterBuilder instead")]] + StyledWriter : public Writer { public: StyledWriter(); ~StyledWriter() override = default; @@ -294,8 +298,9 @@ private: #pragma warning(push) #pragma warning(disable : 4996) // Deriving from deprecated class #endif -class [[deprecated( - "Use StreamWriterBuilder instead")]] JSON_API StyledStreamWriter { +class JSON_API + [[deprecated("Use StreamWriterBuilder instead")]] + StyledStreamWriter { public: /** * \param indentation Each level will be indented by this amount extra. diff --git a/src/jsontestrunner/main.cpp b/src/jsontestrunner/main.cpp index d2d41aa..2155d29 100644 --- a/src/jsontestrunner/main.cpp +++ b/src/jsontestrunner/main.cpp @@ -56,9 +56,11 @@ static Json::String readInputTestFile(const char* path) { return ""; fseek(file, 0, SEEK_END); long const size = ftell(file); + if (size == -1) + return ""; size_t const usize = static_cast<unsigned long>(size); fseek(file, 0, SEEK_SET); - char* buffer = new char[size + 1]; + char* buffer = new char[usize + 1]; buffer[size] = 0; Json::String text; if (fread(buffer, 1, usize, file) == usize)