Reuse code for error clearing
diff --git a/tinyxml2.cpp b/tinyxml2.cpp
index 826eb9b..6ce4332 100755
--- a/tinyxml2.cpp
+++ b/tinyxml2.cpp
@@ -1955,9 +1955,7 @@
#ifdef DEBUG
const bool hadError = Error();
#endif
- _errorID = XML_SUCCESS;
- _errorStr1.Reset();
- _errorStr2.Reset();
+ ClearError();
delete [] _charBuffer;
_charBuffer = 0;
@@ -2162,7 +2160,7 @@
{
// Clear any error from the last save, otherwise it will get reported
// for *this* call.
- SetError(XML_SUCCESS, 0, 0);
+ ClearError();
XMLPrinter stream( fp, compact );
Print( &stream );
return _errorID;