<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to 9: Error returns ezxml_root object, not NULL</title><link>https://sourceforge.net/p/ezxml/bugs/9/</link><description>Recent changes to 9: Error returns ezxml_root object, not NULL</description><atom:link href="https://sourceforge.net/p/ezxml/bugs/9/feed.rss" rel="self"/><language>en</language><lastBuildDate>Mon, 13 Oct 2008 01:25:25 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/ezxml/bugs/9/feed.rss" rel="self" type="application/rss+xml"/><item><title>Error returns ezxml_root object, not NULL</title><link>https://sourceforge.net/p/ezxml/bugs/9/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Header file says that (say) ezxml_str returns NULL on failure.  However, checking out the code reveals that on failure, ezxml_str usually returns a root with the 'error' field set!&lt;/p&gt;
&lt;p&gt;Example (version 0.8.6):&lt;/p&gt;
&lt;p&gt;line 470-477:&lt;br /&gt;
-----&lt;br /&gt;
ezxml_t ezxml_parse_str(char *s, size_t len)&lt;br /&gt;
{&lt;br /&gt;
ezxml_root_t root = (ezxml_root_t)ezxml_new(NULL);&lt;br /&gt;
char q, e, *d, **attr, **a = NULL; // initialize a to avoid compile warning&lt;br /&gt;
int l, i, j;&lt;/p&gt;
&lt;p&gt;root-&amp;gt;m = s;&lt;br /&gt;
if (! len) return ezxml_err(root, NULL, "root tag missing");&lt;br /&gt;
-----&lt;/p&gt;
&lt;p&gt;ezxml_err returns "&amp;amp; root-&amp;gt;xml".&lt;/p&gt;
&lt;p&gt;Because the root structure is opaque, there's no way for client code to check for errors!  Nor is there any indication that 'root' is erroneous except checking whether root-&amp;gt;err is non-empty.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Nom</dc:creator><pubDate>Mon, 13 Oct 2008 01:25:25 -0000</pubDate><guid>https://sourceforge.net4299552cb3885cea9832501a1b738cf3465cb3ef</guid></item></channel></rss>