summaryrefslogtreecommitdiff
path: root/xml.c
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2018-08-23 19:11:52 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2018-08-23 19:11:52 +0200
commit9d96397cef3d75f2af96b7a31bf2aef910346b0c (patch)
treef5a67d0d596db10ef2b8cc56cfb2215f6ec66db8 /xml.c
parent6ce5f1e755eb81bc89bc0fa5d5650173e3f697b1 (diff)
xml: remove TODO comments and add a note
Diffstat (limited to 'xml.c')
-rw-r--r--xml.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/xml.c b/xml.c
index a34a12c..c3a0f7c 100644
--- a/xml.c
+++ b/xml.c
@@ -350,8 +350,9 @@ xml_parse(XMLParser *x)
if (c == '!') { /* cdata and comments */
for (tagdatalen = 0; (c = x->getnext()) != EOF;) {
- if (tagdatalen <= sizeof("[CDATA[") - 1) /* if (d < sizeof(x->data)) */
- x->data[tagdatalen++] = c; /* TODO: prevent overflow */
+ /* NOTE: sizeof(x->data) must be atleast sizeof("[CDATA[") */
+ if (tagdatalen <= sizeof("[CDATA[") - 1)
+ x->data[tagdatalen++] = c;
if (c == '>')
break;
else if (c == '-' && tagdatalen == sizeof("--") - 1 &&
@@ -381,7 +382,7 @@ xml_parse(XMLParser *x)
x->isshorttag = ispi;
taglen = 1;
while ((c = x->getnext()) != EOF) {
- if (c == '/') /* TODO: simplify short tag? */
+ if (c == '/')
x->isshorttag = 1; /* short tag */
else if (c == '>' || isspace(c)) {
x->tag[taglen] = '\0';