Error returns ezxml_root object, not NULL
Status: Beta
Brought to you by:
voisine
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!
Example (version 0.8.6):
line 470-477:
-----
ezxml_t ezxml_parse_str(char *s, size_t len)
{
ezxml_root_t root = (ezxml_root_t)ezxml_new(NULL);
char q, e, *d, **attr, **a = NULL; // initialize a to avoid compile warning
int l, i, j;
root->m = s;
if (! len) return ezxml_err(root, NULL, "root tag missing");
-----
ezxml_err returns "& root->xml".
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->err is non-empty.