fix a fopen bug: rb should be w

This commit is contained in:
Lee Thomason 2012-09-25 13:22:41 -07:00
parent 99024dc20b
commit 3cd66ee850
1 changed files with 1 additions and 1 deletions

View File

@ -1602,7 +1602,7 @@ int XMLDocument::SaveFile( const char* filename, bool compact )
errno_t err = fopen_s(&fp, filename, "w" ); errno_t err = fopen_s(&fp, filename, "w" );
if ( !fp || err) { if ( !fp || err) {
#else #else
fp = fopen( filename, "rb" ); fp = fopen( filename, "w" );
if ( !fp) { if ( !fp) {
#endif #endif
SetError( XML_ERROR_FILE_COULD_NOT_BE_OPENED, filename, 0 ); SetError( XML_ERROR_FILE_COULD_NOT_BE_OPENED, filename, 0 );