apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel May" <dan...@spryware.com>
Subject apr_xml_parser_geterror()
Date Fri, 19 Oct 2007 19:53:43 GMT
Should the function

apr_xml_parser_geterror(apr_xml_parser *parser, char *errbuf, apr_size_t
errbufsize)

crash if apr_xml_parser *parser is not initialized ?  That is the case
today.  From the examples, it is common to do the following:


   rv = apr_xml_parse_file(pool, &parser, &doc, fd, 2000);
   if (rv != APR_SUCCESS) 
   {
        fprintf(stderr, "APR Error %s\nXML Error: %s\n",
                apr_strerror(rv, errbuf, sizeof(errbuf)),
             apr_xml_parser_geterror(parser, errbufXML,
sizeof(errbufXML)));
        return rv;
    }

There are cases where the parser is NULL and apr_xml_parser_geterror()
blows up.

Daniel May

 


Mime
View raw message