diff --git a/lex_util.cpp b/lex_util.cpp index 756199e..7bea981 100644 --- a/lex_util.cpp +++ b/lex_util.cpp @@ -219,7 +219,7 @@ void v_assign_int_to_string (TIXML_STRING & S_string, int i_val) { char ca_int [80]; - sprintf (ca_int, "%d", i_val); + snprintf (ca_int, sizeof(ca_int), "%d", i_val); S_string = ca_int; } @@ -229,7 +229,7 @@ void v_assign_double_to_string (TIXML_STRING & S_string, double d_val) { char ca_int [80]; - sprintf (ca_int, "%f", d_val); + snprintf (ca_int, sizeof(ca_int), "%f", d_val); while (ca_int [strlen (ca_int) - 1] == '0') ca_int [strlen (ca_int) - 1] = 0; if (ca_int [strlen (ca_int) - 1] == '.') diff --git a/tinyxmlparser.cpp b/tinyxmlparser.cpp index 9ea52ef..07c5041 100644 --- a/tinyxmlparser.cpp +++ b/tinyxmlparser.cpp @@ -1349,7 +1349,7 @@ const char* TiXmlComment::Parse( const char* p, TiXmlParsingData* data, TiXmlEnc if ( !StringEqual( p, startTag, false, encoding ) ) { - document->SetError( TIXML_ERROR_PARSING_COMMENT, p, data, encoding ); + if ( document ) document->SetError( TIXML_ERROR_PARSING_COMMENT, p, data, encoding ); return 0; } p += strlen( startTag ); @@ -1515,7 +1515,7 @@ const char* TiXmlText::Parse( const char* p, TiXmlParsingData* data, TiXmlEncodi if ( !StringEqual( p, startTag, false, encoding ) ) { - document->SetError( TIXML_ERROR_PARSING_CDATA, p, data, encoding ); + if ( document ) document->SetError( TIXML_ERROR_PARSING_CDATA, p, data, encoding ); return 0; } p += strlen( startTag ); diff --git a/xpath_processor.cpp b/xpath_processor.cpp index d8d3f81..4b62ef5 100644 --- a/xpath_processor.cpp +++ b/xpath_processor.cpp @@ -798,6 +798,7 @@ void xpath_processor::v_execute_one ( if (! o_skip_only) { S_name = S_pop_string (); + if (erpp_arg) v_execute_function (S_name, u_variable, erpp_arg); } }