That works for me.  I worked around it in my code, but thought I would
let the group know about it
so others who use the examples as a starting point would not get bit.

/Daniel
 

-----Original Message-----
From: William A. Rowe, Jr. [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 19, 2007 3:03 PM
To: Daniel May
Cc: dev@apr.apache.org
Subject: Re: apr_xml_parser_geterror()

Daniel May wrote:
> 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)));

It sounds like examples are wrong.

 >              !parser ? "Unknown" : apr_xml_parser_geterror(parser,
errbufXML,

might help?  (Would solve even if we decide this is something to fix,
for users bound to older apr-util's.)

Reply via email to