summaryrefslogtreecommitdiff
path: root/xml.c
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2015-08-14 17:03:53 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2015-08-14 17:03:53 +0200
commit6bc48bb27a50d711cb104d010998a1c1cee6e8d2 (patch)
tree8e772ba8622d050c749cc8582084c9169b906b3d /xml.c
parent84831ac69e9a20800a50a902aa5e7000168f3d45 (diff)
minor code-style improvements
Diffstat (limited to 'xml.c')
-rw-r--r--xml.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/xml.c b/xml.c
index 518f9d3..8530916 100644
--- a/xml.c
+++ b/xml.c
@@ -388,20 +388,19 @@ xml_parse(XMLParser *x)
if (c == '>')
break;
else if (c == '-' && tagdatalen == sizeof("--") - 1 &&
- (x->data[0] == '-')) { /* comment */
+ (x->data[0] == '-')) {
xml_parsecomment(x);
break;
} else if (c == '[') {
if (tagdatalen == sizeof("[CDATA[") - 1 &&
- x->data[1] == 'C' && x->data[2] == 'D' &&
- x->data[3] == 'A' && x->data[4] == 'T' &&
- x->data[5] == 'A' && x->data[6] == '[') { /* CDATA */
+ !strncmp(x->data, "[CDATA[", tagdatalen)) {
xml_parsecdata(x);
break;
}
}
}
- } else { /* normal tag (open, short open, close), processing instruction. */
+ } else {
+ /* normal tag (open, short open, close), processing instruction. */
if (isspace(c))
while ((c = xml_getnext(x)) != EOF && isspace(c))
;