+30-04-2009
+ * Fix an off by one problem.
+
28-04-2009
* changes to the code to allow walking the xml-tree using "*" as a node name
* add printxml, an example utility that walks an xml-tree and prints it
restlen -= new-cur;
cur = new;
}
-
if (*cur != '/') /* cascading tag found */
{
char *node = "*";
- size_t slen = restlen+1;
+ size_t slen = restlen+1; /* due to cur-1 below*/
size_t nlen = 1;
size_t pos = -1;
*len = XML_UNEXPECTED_EOF;
return 0;
}
- else new = cur + slen;
- }
- restlen -= slen;
- cur = new;
+ slen--;
+ new = cur + slen;
+ restlen -= slen;
+ }
+ else restlen -= slen;
/*
* look for the closing tag of the cascading block
*/
+ cur = new;
new = memchr(cur, '<', restlen);
if (!new)
{
*len = XML_ELEMENT_NO_CLOSING_TAG;
return 0;
}
- }
+ } /* while */
if (found == 0)
{