Renamed Reader::getFormatedErrorMessages() to getFormattedErrorMessages. Bug #3023708 (Formatted has 2 't'). The old member function is deprecated but still present for backward compatibility.
diff --git a/src/jsontestrunner/main.cpp b/src/jsontestrunner/main.cpp
index 2da3ede..dfb6150 100644
--- a/src/jsontestrunner/main.cpp
+++ b/src/jsontestrunner/main.cpp
@@ -105,7 +105,7 @@
{
printf( "Failed to parse %s file: \n%s\n",
kind.c_str(),
- reader.getFormatedErrorMessages().c_str() );
+ reader.getFormattedErrorMessages().c_str() );
return 1;
}
diff --git a/src/lib_json/json_reader.cpp b/src/lib_json/json_reader.cpp
index 8bc75e3..0d59c46 100644
--- a/src/lib_json/json_reader.cpp
+++ b/src/lib_json/json_reader.cpp
@@ -839,9 +839,17 @@
}
+// Deprecated. Preserved for backward compatibility
std::string
Reader::getFormatedErrorMessages() const
{
+ return getFormattedErrorMessages();
+}
+
+
+std::string
+Reader::getFormattedErrorMessages() const
+{
std::string formattedMessage;
for ( Errors::const_iterator itError = errors_.begin();
itError != errors_.end();
@@ -862,7 +870,7 @@
Json::Reader reader;
bool ok = reader.parse(sin, root, true);
//JSON_ASSERT( ok );
- if (!ok) throw std::runtime_error(reader.getFormatedErrorMessages());
+ if (!ok) throw std::runtime_error(reader.getFormattedErrorMessages());
return sin;
}
diff --git a/src/lib_json/json_value.cpp b/src/lib_json/json_value.cpp
index 218c127..ce1dec3 100644
--- a/src/lib_json/json_value.cpp
+++ b/src/lib_json/json_value.cpp
@@ -54,6 +54,7 @@
if ( length == unknown )
length = (unsigned int)strlen(value);
char *newString = static_cast<char *>( malloc( length + 1 ) );
+ JSON_ASSERT_MESSAGE( newString != 0, "Failed to allocate string value buffer" );
memcpy( newString, value, length );
newString[length] = 0;
return newString;
@@ -112,7 +113,7 @@
{
if ( comment_ )
releaseStringValue( comment_ );
- JSON_ASSERT( text );
+ JSON_ASSERT( text != 0 );
JSON_ASSERT_MESSAGE( text[0]=='\0' || text[0]=='/', "Comments must start with /");
// It seems that /**/ style comments are acceptable as well.
comment_ = duplicateStringValue( text );