Menu

No error set when file's length is 0

Developer
igorv007
2005-12-31
2013-05-20
  • igorv007

    igorv007 - 2005-12-31

    Hi,
    I've noticed that in the TiXmlDocument::LoadFile() function there is the following code:

    if ( length == 0 )
    {
            fclose( file );
        return false;
    }

    So when file's length is 0 you do not set the error (error id is 0) and it does not seem correct to me.
    IMO the correct way will be to set an error to TIXML_ERROR_DOCUMENT_EMPTY like you do when a document contains a few empty spaces.

    What do you think?

    Thanks,
    Igor.

     
    • Lee Thomason

      Lee Thomason - 2006-01-06

      Igor --

      I think you are correct - it should be consistent. I entered a bug.

      lee

       

Log in to post a comment.

MongoDB Logo MongoDB