summaryrefslogtreecommitdiff
path: root/libezxml
diff options
context:
space:
mode:
authorPatrick Reynolds <cpreynolds@gmail.com>2010-07-01 18:45:24 -0400
committerLars-Dominik Braun <PromyLOPh@lavabit.com>2010-07-11 14:25:20 +0200
commitdd509097513d17ad74013df2c5a037b1b1b48173 (patch)
treedb8055c39f4afa20e45b9c6609815f725e132409 /libezxml
parent3631791ee6431abf3dfec7db698f2a2778a867c3 (diff)
downloadpianobar-windows-dd509097513d17ad74013df2c5a037b1b1b48173.tar.gz
pianobar-windows-dd509097513d17ad74013df2c5a037b1b1b48173.tar.bz2
pianobar-windows-dd509097513d17ad74013df2c5a037b1b1b48173.zip
Fixing a warning in ezxml.
Assignment as used in the prefix ++ results in undefined behavior when the variable is used in a function call later in the while loop condition. Most of the time this works, but the behavior is technically undefined.
Diffstat (limited to 'libezxml')
-rw-r--r--libezxml/src/ezxml.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libezxml/src/ezxml.c b/libezxml/src/ezxml.c
index 52deb95..967d535 100644
--- a/libezxml/src/ezxml.c
+++ b/libezxml/src/ezxml.c
@@ -426,7 +426,8 @@ static short ezxml_internal_dtd(ezxml_root_t root, char *s, size_t len)
else *s = '\0'; // null terminate tag name
for (i = 0; root->attr[i] && strcmp(n, root->attr[i][0]); i++);
- while (*(n = ++s + strspn(s, EZXML_WS)) && *n != '>') {
+ ++s; // ansi cpr
+ while (*(n = s + strspn(s, EZXML_WS)) && *n != '>') {
if (*(s = n + strcspn(n, EZXML_WS))) *s = '\0'; // attr name
else { ezxml_err(root, t, "malformed <!ATTLIST"); break; }
@@ -467,6 +468,7 @@ static short ezxml_internal_dtd(ezxml_root_t root, char *s, size_t len)
root->attr[i][j + 1] = (v) ? ezxml_decode(v, root->ent, *c)
: NULL;
root->attr[i][j] = n; // attribute name
+ ++s;
}
}
else if (! strncmp(s, "<!--", 4)) s = strstr(s + 4, "-->"); // comments